Details
-
Type:
Improvement
-
Status: Needs Design
-
Priority:
Minor
-
Resolution: Unresolved
-
Labels:
Description
Currently we have a lot code where the code catch IOException, wrap the IOException as a process specific operation exception (CohortSaveException) and then re-throw this exception to the original caller.
This process would make a lot of sense if we plan to handle specific operation exception differently, but currently all of those exceptions are handled by logging that particular exception.
Example:
} catch (CohortController.CohortDownloadException e) { Log.e(TAG, "Exception when trying to download cohorts", e); result[0] = SyncStatusConstants.DOWNLOAD_ERROR; return result; } catch (CohortController.CohortSaveException e) { Log.e(TAG, "Exception when trying to save cohorts", e); result[0] = SyncStatusConstants.SAVE_ERROR; return result; } catch (CohortController.CohortDeleteException e) { Log.e(TAG, "Exception occurred while deleting voided cohorts", e); result[0] = SyncStatusConstants.DELETE_ERROR; return result; } // result[0] never being used anywhere.