errors.php 716 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. /**
  3. * Lithium: the most rad php framework
  4. *
  5. * @copyright Copyright 2011, Union of RAD (http://union-of-rad.org)
  6. * @license http://opensource.org/licenses/bsd-license.php The BSD License
  7. */
  8. use lithium\core\ErrorHandler;
  9. use lithium\action\Response;
  10. use lithium\net\http\Media;
  11. ErrorHandler::apply('lithium\action\Dispatcher::run', array(), function($info, $params) {
  12. $response = new Response(array(
  13. 'request' => $params['request'],
  14. 'status' => $info['exception']->getCode()
  15. ));
  16. Media::render($response, compact('info', 'params'), array(
  17. 'controller' => '_errors',
  18. 'template' => 'development',
  19. 'layout' => 'error',
  20. 'request' => $params['request']
  21. ));
  22. return $response;
  23. });
  24. ?>