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

ShotgunError exception too broad? #183

Open
mdfisher opened this issue Sep 10, 2018 · 1 comment
Open

ShotgunError exception too broad? #183

mdfisher opened this issue Sep 10, 2018 · 1 comment

Comments

@mdfisher
Copy link

I generally base exceptions on StandardError because it's usually bad policy to catch Exception because it's too broad. PyCharm complains about it so I know it's not just my own issue.

Would it harm downstream exc handlers to base off of StandardError or something even lower in the exc mro?

Any handlers which are already catching Exception won't be affected. StopIteration and Warming excs don't seem to be necessary for the ShotgunError exc hier.

@manneohrstrom
Copy link
Contributor

Thanks for the great feedback!

We totally agree!! We are trying to be good python citizens and have been trying to begin moving away from these broad catch-all traps in favour of more specific ones (RuntimeError, StandardError). We are trying to improve the code as we go and as we create new code. New code is linted by hound to make sure these things are caught as part of the CR process. Right now, it's an incremental process.

Is there any particular case you are worried about or a bug that you have seen or is this more of a general concern?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants