Hi - Any feedback from people re how they handle exception handling in RoR? Here’s what I’m doing…
I’ve ended up doing the following so far, some of which are adjustments to Jamis Buck’some “Exception Notification” plugin. I’m still optimizing this for my own usage as I go. Hope this helps (any ideas/feedback welcome):
Usage: if error_situation_occurs raise Error.new( “Message to User Here - Will be shown on error page”, “Additional message that will go to log file for developers”, Logger::ERROR) end
Features:
-
Separate user & developer messages
-
Do not have to catch such errors back in controller or views as the below-mentioned rails rescue frame work will handle ( i.e. less work, cleaner code)
-
Just need to raise the Error exception which then triggers/implies/carries out: (a) appropriate email message to user (b) developer specific additional message to logs
(c) severity of log entry raised (b) triggers Email/SMS alert based on severity of the error (use of Ruby Logger severity levels)