-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace except Exception
s with proper error handling
#1508
Comments
Love this idea. |
First, There Another approach to solve this with the general exception, using the following code: Second, The annoying thing about this, is there are many messages printed after exceptions caught.
it's the same exception caught but from different threads. it's so annoying. Third, There are errors that do not require continuing to work such as |
Catching all errors with
Exception
is enticing, but has several issues.Properly catching the errors you expect to get:
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 bareException
.I want to avoid situations like this; exceptions should catch only expected behavior.
The text was updated successfully, but these errors were encountered: