-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Open
Description
Catching all errors with Exception is enticing, but has several issues.
Properly catching the errors you expect to get:
- improves readability and maintainability
- improves error diagnostics
- 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.