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

Stop converting HTTPError to ValueError in mlbgame/data.py #92

Open
dowski opened this issue Apr 27, 2018 · 1 comment
Open

Stop converting HTTPError to ValueError in mlbgame/data.py #92

dowski opened this issue Apr 27, 2018 · 1 comment

Comments

@dowski
Copy link
Contributor

dowski commented Apr 27, 2018

Converting HTTPError to ValueError loses valuable information about the failure. If the HTTPError itself was allowed to be raised then callers could look at the status code and determine if they want to try the call again (in the case of a 5xx error) or stop trying (4xx error).

Or maybe it could raise new exceptions defined by the mlbgame library? Fatal or Retryable?

@panzarino
Copy link
Owner

@dowski I would prefer to use a custom exception rather than a HTTPError.

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

No branches or pull requests

2 participants