Skip to content

Allow not to retry some exceptions#87

Open
fatkodima wants to merge 1 commit intokamui:masterfrom
fatkodima:not-option
Open

Allow not to retry some exceptions#87
fatkodima wants to merge 1 commit intokamui:masterfrom
fatkodima:not-option

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!

@kamui kamui force-pushed the master branch 3 times, most recently from 6196a1e to c448885 Compare March 20, 2025 03:57
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

Comments