lantins/resque-retry — pull request #52 by til (2012-05-21 08:28:28+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