timbru31 commented on a change in pull request #549: fix(ios): handle video 
transcoding cancel exception
URL: 
https://github.com/apache/cordova-plugin-camera/pull/549#discussion_r371532532
 
 

 ##########
 File path: src/ios/CDVCamera.m
 ##########
 @@ -512,8 +512,13 @@ - (void)resultForImage:(CDVPictureOptions*)options 
info:(NSDictionary*)info comp
 
 - (CDVPluginResult*)resultForVideo:(NSDictionary*)info
 {
-    NSString* moviePath = [[info objectForKey:UIImagePickerControllerMediaURL] 
absoluteString];
-    return [CDVPluginResult resultWithStatus:CDVCommandStatus_OK 
messageAsString:moviePath];
+    @try {
+        NSString* moviePath = [[info 
objectForKey:UIImagePickerControllerMediaURL] absoluteString];
+        return [CDVPluginResult resultWithStatus:CDVCommandStatus_OK 
messageAsString:moviePath];
+    } @catch (NSException *exception) {
+        NSLog(@"Camera.resultForVideo: error retrieving file path");
+        return [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR 
messageAsString:@""];
 
 Review comment:
   Great, one minor request: Could you pass in the exception message into the 
Cordova callback?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to