There are several guidelines for error reporting, that are usually based on giving to the user useful information when he or she does something wrong, but to give this kind of information you need to be handling the error and know that it can happen. There are also tons of articles about designing 404 error pages. But, what can you do when it's a new, unhandled error provoked by a failure in the software?
Are there some guidelines about how to nicely report totally unexpected errors in a web site as an unexpected error 500?
What header message should be shown in that case? something like "Sorry, an unexpected error has ocurred" would be enough?
What information should be given?
Should it have mechanisms to help to report the failure to developers? Which ones?