When an unhandled exception occurs, Lion shows the exception message as well as the trace and some other extra information in a page as following
This page shows the type of exceptions (i.e. Internal core error), the error code (i.e. 55712), the error message (i.e. Unable to resolve a controller for code: hello).
It also shows the complete trace, which allow to expand the excerpt of code of each call within the execution stack
Customizing the error page
Lion delegates in a class, the Error Printer, to render and output the error page. However, Lion allow to customize that page as well as the content that is shown to the user
To do that, we have to change the ERROR_PRINTER setting to point to our own class within the app/config/application.ini
The error printer is a class implementing the __IErrorPrinter interface, which includes to create a method __IErrorPrinter::displayError() that is call when an unhandled exceptions is raised to.
We can use the MVC, as we're doing to render other pages, to output this page.
i.e.
<?php
class MyOwnErrorPrinter implements __IErrorPrinter {
public function displayError(Exception $exception) {
$request = $this->_getRequest($exception);
$action_identity = new __ActionIdentity('yourOwnErrorControllerCodeHere');
So we can design our own controller and view to render our exceptions and errors.
i.e. Look the difference between the same error shown by the default error printer, and by a customized error printer:
The first page shows how the error is shown by a customized error printer. The second screenshot shows the same error rendered by the default error printer class.