in reply to Does fatalsToBrowser give too much information to a cracker?

I prefer not to use fatalsToBrowser in production because I don't want to expose paths, file names or specific errors to users. I sometimes use it in development, but find that tailing my server logs in another window is just as easy.

In my current project, I use cluck() to send a stack trace and error to my server logs when something goes wrong and just print out a generic error to my users. For my purposes, I don't need them to know what the specific problem is (it probably won't help them to know if it's a database error as opposed to a code error, for example).

Here's a crude example of what I currently use. I'm sure there are a number of far better solutions, but this seems to work for me right now (and I'm still developing my debugging/error-reporting/error-handling skills):

sub ErrorHandler { if ($DBI::errstr) { cluck("The following database error occurred:\n $DBI::errstr") +; print "Error message to display to your users."; } else { cluck "An error has occurred"; print "Error message to display to your users."; } }