Skip to content

Commit

Permalink
Merge pull request #2906 from dimagi/logImageSaveError
Browse files Browse the repository at this point in the history
logs exceptions encountered while saving image
  • Loading branch information
shubham1g5 authored Dec 4, 2024
2 parents d60d242 + 3ed066a commit a90c404
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public static boolean processCaptureResponse(FormEntryActivity activity,
try {
return scaleAndSaveImage(originalImage, isImage, instanceFolder, activity);
} catch (IOException e) {
e.printStackTrace();
Logger.exception("Error while trying to save captured image", e);
Toast.makeText(activity, Localization.get("image.capture.not.saved"), Toast.LENGTH_LONG).show();
return false;
}
Expand Down Expand Up @@ -177,12 +177,9 @@ private static void processImageGivenFileUri(FormEntryActivity activity, String
} catch (FileExtensionNotFoundException e) {
Logger.exception("Error while processing chosen image ", e);
Toast.makeText(activity, Localization.get("image.selection.invalid.extension"), Toast.LENGTH_LONG).show();
return;
} catch (IOException e) {
e.printStackTrace();
Logger.exception("Error while processing chosen image ", e);
Toast.makeText(activity, Localization.get("image.selection.not.saved"), Toast.LENGTH_LONG).show();
return;
}
}

Expand All @@ -198,7 +195,7 @@ private static void processImageGivenFilePath(FormEntryActivity activity, String
try {
scaleAndSaveImage(originalImage, true, instanceFolder, activity);
} catch (IOException e) {
e.printStackTrace();
Logger.exception("Error while saving chosen image ", e);
Toast.makeText(activity, Localization.get("image.selection.not.saved"), Toast.LENGTH_LONG).show();
}
} else {
Expand Down

0 comments on commit a90c404

Please sign in to comment.