Skip to content

Replace except Exceptions with proper error handling #1508

@yoonthegoon

Description

@yoonthegoon
image

Catching all errors with Exception is enticing, but has several issues.
Properly catching the errors you expect to get:

  1. improves readability and maintainability
  2. improves error diagnostics
  3. avoids unexpected behavior

There are cases where you may be passing one argument to a function that requires two, like filter that will go unnoticed while running or testing, as the error it raises just gets caught by a bare Exception.
I want to avoid situations like this; exceptions should catch only expected behavior.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions