Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

logs exceptions encountered while saving image #2906

Merged
merged 1 commit into from
Dec 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading