@neoskola/auto-play 0.2.13 → 0.2.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -74,7 +74,7 @@ class AutoPlayInterfaceController: NSObject, CPInterfaceControllerDelegate {
|
|
|
74
74
|
private func pushNowPlayingTemplateSafely(animated: Bool) async -> Bool {
|
|
75
75
|
return await withCheckedContinuation { continuation in
|
|
76
76
|
do {
|
|
77
|
-
try ObjCExceptionCatcher.
|
|
77
|
+
try ObjCExceptionCatcher.execute {
|
|
78
78
|
self.interfaceController.pushTemplate(
|
|
79
79
|
CPNowPlayingTemplate.shared,
|
|
80
80
|
animated: animated
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
/// with CPNowPlayingTemplate). This wrapper makes those exceptions catchable.
|
|
7
7
|
@interface ObjCExceptionCatcher : NSObject
|
|
8
8
|
|
|
9
|
-
+ (BOOL)
|
|
10
|
-
|
|
9
|
+
+ (BOOL)executeBlock:(void(NS_NOESCAPE ^_Nonnull)(void))block
|
|
10
|
+
error:(NSError * _Nullable * _Nullable)error;
|
|
11
11
|
|
|
12
12
|
@end
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
@implementation ObjCExceptionCatcher
|
|
4
4
|
|
|
5
|
-
+ (BOOL)
|
|
5
|
+
+ (BOOL)executeBlock:(void(NS_NOESCAPE ^)(void))block error:(NSError **)error {
|
|
6
6
|
@try {
|
|
7
|
-
|
|
7
|
+
block();
|
|
8
8
|
return YES;
|
|
9
9
|
} @catch (NSException *exception) {
|
|
10
10
|
NSLog(@"[ObjCExceptionCatcher] Caught exception: %@ — %@", exception.name, exception.reason);
|