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

Allow not to retry some exceptions #87

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fatkodima
Copy link
Contributor

@fatkodima fatkodima commented Aug 25, 2019

This is very useful when you want to retry a lot of types of exceptions, except for, let's say, one.
And to not list all of them, you can just type :on with :not.

class UnreliableServiceException < StandardError; end
class ServiceUnavailableException < UnreliableServiceException; end
class LimitExceededException < UnreliableServiceException; end
# ... 10 more exception classes...
class AccountExpiredException < UnreliableServiceException; end

Retriable.retriable(on: UnreliableServiceException, not: AccountExpiredException) do
  # do something
end

Non whitespace changes

@Sylor-huang
Copy link

I think this is a good idea!

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.

2 participants