add exception handle
This commit is contained in:
parent
141b02b142
commit
65105eabfc
@ -33,6 +33,9 @@ - (void)getImageInfo:(NSDictionary *)resource withPromise:(DoricPromise *)promis
|
|||||||
@"height": @(image.size.height)
|
@"height": @(image.size.height)
|
||||||
}];
|
}];
|
||||||
}];
|
}];
|
||||||
|
[asyncResult setExceptionCallback:^(NSException * _Nonnull e) {
|
||||||
|
DoricLog(@"Cannot load resource %s, %s", resource.description, e.description);
|
||||||
|
}];
|
||||||
} else {
|
} else {
|
||||||
DoricLog(@"Cannot find loader for resource %s", resource.description);
|
DoricLog(@"Cannot find loader for resource %s", resource.description);
|
||||||
[promise reject:@"Load error"];
|
[promise reject:@"Load error"];
|
||||||
@ -66,6 +69,9 @@ - (void)decodeToPixels:(NSDictionary *)resource withPromise:(DoricPromise *)prom
|
|||||||
|
|
||||||
[promise resolve:data];
|
[promise resolve:data];
|
||||||
}];
|
}];
|
||||||
|
[asyncResult setExceptionCallback:^(NSException * _Nonnull e) {
|
||||||
|
DoricLog(@"Cannot load resource %s, %s", resource.description, e.description);
|
||||||
|
}];
|
||||||
} else {
|
} else {
|
||||||
DoricLog(@"Cannot find loader for resource %s", resource.description);
|
DoricLog(@"Cannot find loader for resource %s", resource.description);
|
||||||
[promise reject:@"Load error"];
|
[promise reject:@"Load error"];
|
||||||
|
Reference in New Issue
Block a user