From 65105eabfc9ff6b5af30d3bd1f1e2e33166f5e73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=8A=B2=E9=B9=8F?= Date: Mon, 10 Jan 2022 12:04:05 +0800 Subject: [PATCH] add exception handle --- doric-iOS/Pod/Classes/Plugin/DoricImageDecoderPlugin.m | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doric-iOS/Pod/Classes/Plugin/DoricImageDecoderPlugin.m b/doric-iOS/Pod/Classes/Plugin/DoricImageDecoderPlugin.m index 77cf55da..dfa1ac03 100644 --- a/doric-iOS/Pod/Classes/Plugin/DoricImageDecoderPlugin.m +++ b/doric-iOS/Pod/Classes/Plugin/DoricImageDecoderPlugin.m @@ -33,6 +33,9 @@ - (void)getImageInfo:(NSDictionary *)resource withPromise:(DoricPromise *)promis @"height": @(image.size.height) }]; }]; + [asyncResult setExceptionCallback:^(NSException * _Nonnull e) { + DoricLog(@"Cannot load resource %s, %s", resource.description, e.description); + }]; } else { DoricLog(@"Cannot find loader for resource %s", resource.description); [promise reject:@"Load error"]; @@ -66,6 +69,9 @@ - (void)decodeToPixels:(NSDictionary *)resource withPromise:(DoricPromise *)prom [promise resolve:data]; }]; + [asyncResult setExceptionCallback:^(NSException * _Nonnull e) { + DoricLog(@"Cannot load resource %s, %s", resource.description, e.description); + }]; } else { DoricLog(@"Cannot find loader for resource %s", resource.description); [promise reject:@"Load error"];