Ruby Rescuing Precedence

2013-08-25

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.

I’m currently working on fyra.sh, a CLI-first static site deployment tool where you push your site and it’s served globally through a built-in CDN, without the overhead of heavy platforms.