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

Add optional retry_error_callback param #119

Merged
merged 2 commits into from
May 1, 2018

Conversation

gulducat
Copy link

@gulducat gulducat commented Apr 29, 2018

Being able to call a custom function when all retries have failed (without necessarily raising an exception) is useful for a few applications.

  • Do nothing (raise no exception without repeated try/except boilerplate or extra function wrapper)
  • Return a default value
  • Return the value of the last attempt (if retry_if_result for example)
  • Really anything you can think to do with the last Future object

A couple of these uses were issues on the retrying module, which I made a PR to (rholder/retrying#78) before realizing this is probably a better place for it.

@gulducat
Copy link
Author

Hey there @jd - looks like you addressed the mergify failure in 1c0b572 :)

Any feedback on this PR that I can address? (aside from merging in latest master)

@mergify mergify bot merged commit 723ba6a into jd:master May 1, 2018
@jd
Copy link
Owner

jd commented May 1, 2018

@dbwpe Looks good to me, released 4.12.0 with that.

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

Successfully merging this pull request may close these issues.

3 participants