Stack: Ruby 2.2, Rails 4.2, and Honeybadger.
I've been working on the error handling code for my site. I've noticed that error handling has become a real mess though out the site, and I've been looking for a way to standardize error handling.
The following "generic" error types have been found:
- Record/resource not found
- Failure to save record
- Validation issues
- Rights/Permissions errors
- Other (Usually probing bots, double clicks, or WTF?)
With the following resulting actions.
- Notify Error Collating resource (maybe)
- Save data; if a particularly long form input
- Response: Redirect to an error page (flash[:error]='?')
- Response: Return a JSON string (AJAX requests)
- Response: Various Status codes http 3xx, 4xx, 5xx
- Customized message for developer (maybe); quite lengthy in some cases
- Customized message for user
- Silently do nothing
And then process issues
- Roll back
- return (exiting the action; and not allowing further action)
Does anyone know of a Gem/Module/Tutorial that handles these collective issues holistically?
Thank you in advance!
-daniel