David - Musings of an SRE

Ruby Rescuing Precedence

When doing a rescue_from in your controller, note that:

# controller
rescue_from Exception, :with => :do_this
rescue_from SomeOtherException, :with => :do_that

def ...

Exceptions always run in precedence, with the later rescue taking in a higher priority.

Therefore, if you ever want SomeOtherException to be rescued, it has to be later than the catch-all Exception.