Exception handling for Ruby on Rails