From 3ed066a3af15ac65b5c27bd395769f546ecfccc1 Mon Sep 17 00:00:00 2001 From: Shubham Goyal Date: Wed, 4 Dec 2024 09:48:01 +0530 Subject: [PATCH] logs exceptions encountered while saving image --- .../activities/components/ImageCaptureProcessing.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/app/src/org/commcare/activities/components/ImageCaptureProcessing.java b/app/src/org/commcare/activities/components/ImageCaptureProcessing.java index 003c456c91..c36c68b307 100644 --- a/app/src/org/commcare/activities/components/ImageCaptureProcessing.java +++ b/app/src/org/commcare/activities/components/ImageCaptureProcessing.java @@ -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; } @@ -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; } } @@ -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 {