lantins/resque-retry — pull request #63 by til (2012-07-29 15:32:14+00:00)
Title: Match exception instance against retry_exceptions

This allows to 'tag' exceptions with a module instead of having to
wrap them in custom exception classes, which is useful when you want
to keep the original exception for logging and diagnosis after the
retry limit was exceeded. Using the === operator makes the matching
work the same as the ruby rescue clause.

Example:

module TransientError; end

def foo
...
rescue Timeout::Error => e
raise e.extend(TransientError)
end

class SomeJob
def self.retry_exceptions
[TransientError]
end
...
end

The old behaviour of the public method retry_exception? so that you
can alternatively pass an exception class instead of an exception
instance to it is kept but documented as deprecated.

This is a reworked version of this commit:

https://github.com/til/resque-retry/commit/cfa397048430ed437c91abffeb4659f59d48ac15