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

Specify exceptions with specific details #108

Open
deeplook opened this issue Oct 15, 2020 · 2 comments
Open

Specify exceptions with specific details #108

deeplook opened this issue Oct 15, 2020 · 2 comments

Comments

@deeplook
Copy link

First: very cool/useful package! Thanks!!

I would like to backoff/retry certain HTTP exceptions like 429, too many requests, but at the moment this isn't possible because there is only a generic requests.exceptions.HTTPError. I've looked into backoff.on_exception() and it looks like it could be extended to have something like a details parameter, maybe a dict with some keys and expected values. Does that sound doable? If so I could give it a try...

@deeplook
Copy link
Author

Meanwhile I've found an easier workaround by throwing my own custom exception and handling that with backoff.

@bgreen-litl
Copy link
Member

You can also use the giveup keyword which allows you to inspect the exception.

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