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

Always raise a more specific exception than Exception #95

Open
richcooper95 opened this issue Feb 2, 2022 · 0 comments
Open

Always raise a more specific exception than Exception #95

richcooper95 opened this issue Feb 2, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@richcooper95
Copy link

Describe the bug
In some places, Exception is raised - this isn't good practice as it makes it almost impossible for the users of the library to catch this specific exception without hiding bugs - see discussion here.

To Reproduce
n/a

Expected behavior
It’s much better to define a custom Exception class, or use one of the built-ins (e.g. RuntimeError).

Examples around here - in this case, InvalidResponseError might be a better exception type.

System (please complete the following information):
n/a

Additional context
n/a

@richcooper95 richcooper95 added the bug Something isn't working label Feb 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant