I'm thinking about some optimal methods for gracefully handling errors on a website. I'm thinking that two modes will dictate how errors are handled:
Development Mode
- Shows all notices, warning, and fatal errors on the view they are generated from
- Errors are displayed in raw format
Production Mode
- Hide all notices and warnings, no matter what
- Redirect fatal errors to a page (something like the fail whale)
- Tell the user that the error has been logged
- Store information about the error in the database or some other type of log (developer's choice)
- E-mail the error to an array of e-mail addresses (developer's choice)
What are your thoughts on this approach? Can you think of a better way to handle errors?