Skip to content

Replace generic catch(Exception) with specific exception types #86

Description

@sfloess

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions