changed so we use the correct exceptions.

This commit is contained in:
Marcus Andersson 2017-12-20 20:25:01 +01:00
parent e5777136b1
commit 93177c8604
3 changed files with 7 additions and 2 deletions

View File

@ -39,6 +39,11 @@
"idiom" : "iphone",
"size" : "60x60",
"scale" : "3x"
},
{
"idiom" : "ios-marketing",
"size" : "1024x1024",
"scale" : "1x"
}
],
"info" : {

View File

@ -76,7 +76,7 @@ public class MutableImage {
}
}
public void cropToPreview(int orientation, float xPercentage, float yPercentage) throws ImageMutationFailedException {
public void cropToPreview(int orientation, float xPercentage, float yPercentage) throws IllegalArgumentException {
int width = this.currentRepresentation.getWidth();
int height = this.currentRepresentation.getHeight();

View File

@ -589,7 +589,7 @@ public class RCTCameraModule extends ReactContextBaseJavaModule
int orientation = _reactContext.getResources().getConfiguration().orientation;
mutableImage.cropToPreview(orientation, paddingWidth, paddingHeight);
} catch (MutableImage.ImageMutationFailedException e) {
} catch (IllegalArgumentException e) {
promise.reject("Error cropping image to preview", e);
}
}