If an error has not been handled by any of the handlers (see operator try), Parser calls method unhandled_exception, This method receives information on the error as well as the stack of calls that caused it. The method's work results in a custom message to be output to a visitor. The error is also recorded in server's error log.
The unhandled_exception message would look best if framed within usual layout of your site. It would be also good if you check technical details and hide them from your visitors.
We recommend placing this method in your site's configuration file.
There is a way to prevent recording an error into error log. Only for particular errors set this flag on: