i am testing an application built with rails and from time to time get bugs
when it happens, ActionView::TemplateError occurs and gets logged in log/production.log
how do i catch it and f.ex. send myself by email whenever it happens somewhere in the app?
what is the best way to do that?
f.ex. in ApplicationController with some sort of before_filter?
the code would be, i imagine
before_filter :app_error_catch
def app_error_catch
begin
rescue ActionView::TemplateError
Mailer.deliver_apperror(errormessage)
end
end
is that close to truth? and how do i get the "errormessage"?
thank you