-
Notifications
You must be signed in to change notification settings - Fork 46
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
Allow retrying based on the "cause" exception #18
Comments
Sorry I never replied to this ticket. I wanted to think about solutions for this and see if other users had similar issues. I haven't come to any conclusions, but wanted to comment to let you know I've read this issue. |
you can sort of do this with a regex in the other than that i don't see any way to deal with the example posted; |
re-reading my comment, i actually had no idea about the |
It would be nice if the |
@rafaelsales i think that would be pretty straightforward to implement if you wanted to try to open a PR, though i'm not sure it's that relevant to this issue |
Sometimes APIs wrap exceptions so that the top-level exception by itself isn't enough to determine whether or not to retry the code. However, the
cause
exception could be used to determine that the code should be retried.Currently retriable only allows retrying based on the raised exception, and doesn't provide a way to examine the caused exception.
Here is an example. In this case, we want to retry based on the
RootCauseError
, but since the API we're using actually raisesDemoError
, the code block doesn't get retried.Two ideas for solving this:
on
option that would then be invoked with the error and would return true or false to determine if the error should be retried. This proc could then examine the error class and its cause, and would have the benefit of also supporting lots of advanced cases that are not possible right now.The text was updated successfully, but these errors were encountered: