diff --git a/component/scanner/src/main/java/one/nem/lacerta/component/scanner/ScannerDataManagerStubFragment.java b/component/scanner/src/main/java/one/nem/lacerta/component/scanner/ScannerDataManagerStubFragment.java index 2d15b51b..ee5ef1f5 100644 --- a/component/scanner/src/main/java/one/nem/lacerta/component/scanner/ScannerDataManagerStubFragment.java +++ b/component/scanner/src/main/java/one/nem/lacerta/component/scanner/ScannerDataManagerStubFragment.java @@ -185,9 +185,21 @@ public class ScannerDataManagerStubFragment extends Fragment { bitmaps[i] = results.get(i).getBitmap(); } - this.documentProcessor.addNewPagesToLast(bitmaps); + try { + this.documentProcessor.addNewPagesToLast(bitmaps); + } catch (Exception e) { + Toast.makeText(getActivity(), "Error occurred while adding pages", Toast.LENGTH_LONG).show(); + Log.e("ScannerDataManagerStubFragment", "Error occurred while adding pages", e); + } - this.documentProcessor.close(); + Toast.makeText(getActivity(), "pages added", Toast.LENGTH_LONG).show(); + + try { + this.documentProcessor.close(); + } catch (Exception e) { + Toast.makeText(getActivity(), "Error occurred while closing documentProcessor", Toast.LENGTH_LONG).show(); + Log.e("ScannerDataManagerStubFragment", "Error occurred while closing documentProcessor", e); + } }); }