Begin, rescue, end for the whole darn app

Hello.

Imagine how paranoid and ugly code would look if one put a
‘begin,rescue, end’ in every action in the app…

With server, mysql, etc errors, is there a way to rescue anything weird
when (not if :frowning: ) it were to ever happen?

Thoughts?

Dominic

Look at the api.rubyonrails.com

http://api.rubyonrails.com/classes/ActionController/Rescue.html#M000067
http://api.rubyonrails.com/classes/ActionController/Rescue.html#M000069
http://api.rubyonrails.com/classes/ActionController/Rescue.html#M000071

You add a function say, rescue_action, in application.rb and it will
handle all your errors.

Thank you very Much Roland. Hope you have a great week.

Roland M. wrote:

Look at the api.rubyonrails.com

http://api.rubyonrails.com/classes/ActionController/Rescue.html#M000067
Peak Obsession
Peak Obsession

You add a function say, rescue_action, in application.rb and it will
handle all your errors.