Part of #27: Improve Error Handling and Logging
Scope
Replace overly broad catch (Exception e) blocks with specific exception types to improve error differentiation and handling.
What to do
- Audit all
catch (Exception e) blocks across the codebase
- Replace with specific catches:
IOException, JsonParseException, HttpTimeoutException, InterruptedException, etc.
- Where multiple specific exceptions are needed, use multi-catch (
catch (IOException | JsonException e))
- Only keep
catch (Exception e) as a final fallback in top-level handlers where truly appropriate
- Log each exception type at the appropriate level
Acceptance criteria
- Broad
catch (Exception e) blocks reduced by at least 80%
- Exception handling is specific enough to distinguish network errors from parse errors from config errors
- Each catch block has appropriate logging and recovery behavior
Part of #27: Improve Error Handling and Logging
Scope
Replace overly broad
catch (Exception e)blocks with specific exception types to improve error differentiation and handling.What to do
catch (Exception e)blocks across the codebaseIOException,JsonParseException,HttpTimeoutException,InterruptedException, etc.catch (IOException | JsonException e))catch (Exception e)as a final fallback in top-level handlers where truly appropriateAcceptance criteria
catch (Exception e)blocks reduced by at least 80%