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

Functions should not exit on requests.exceptions.RequestException #14

Open
doug-the-guy opened this issue Sep 3, 2021 · 0 comments
Open

Comments

@doug-the-guy
Copy link
Contributor

I'm using this API from another script and I've been dealing with the following error:

("Connection broken: ConnectionResetError(104, 'Connection reset by peer')", ConnectionResetError(104, 'Connection reset by peer'))

I tracked it down to the enterprise LiveHunt function I was using which was catching a requests.exceptions.RequestException, printing the exception and then calling exit(1) which left my script hanging. This is the case for every function that wraps an API endpoint.

I recommend instead to just raise the RequestException or wrap it in some custom exception and let the calling code deal with it.

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

1 participant