Skip to content
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

[TECH DEBT] Clean up bare/broad exception handling #60781

Closed
dwoz opened this issue Aug 23, 2021 · 0 comments · Fixed by #60782
Closed

[TECH DEBT] Clean up bare/broad exception handling #60781

dwoz opened this issue Aug 23, 2021 · 0 comments · Fixed by #60782
Assignees

Comments

@dwoz
Copy link
Contributor

dwoz commented Aug 23, 2021

Description of the tech debt to be addressed, include links and screenshots

Clean up exception handling of bare exceptions and/or overly broad exceptions..

Things like this:

try:
   ...
except Exception:
   pass

Should be excepting a specific exception if we know what we are trying to handle. Otherwise we should at least be logging what went wrong so we can more easily narrow down the scope of the exception in the future.

try:
   ...
except Exception as exc:
   log.error(
       "Something went wrong: %s",
        exc, exc_info_on_loglevel=logging.DEBUG,
    )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant