Order of multiple "rescue_from" statements might be unexpected

Posted . Visible to the public.

Take care when using rescue_from to rescue multiple errors.

The following will not work, because later rescue_from statements take precedence and so the first one will never be called:

rescue_from AccessDenied, :with => :redirect_to_home
rescue_from Exception, :with => :render_500

Simply reverse them.

Tobias Kraze
Last edit
License
Source code in this card is licensed under the MIT License.
Posted by Tobias Kraze to makandra dev (2012-06-27 11:38)