errors.php 737 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. /**
  3. * Lithium: the most rad php framework
  4. *
  5. * @copyright Copyright 2013, 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. 'library' => true,
  18. 'controller' => '_errors',
  19. 'template' => 'development',
  20. 'layout' => 'error',
  21. 'request' => $params['request']
  22. ));
  23. return $response;
  24. });
  25. ?>