summaryrefslogtreecommitdiffstats
path: root/config/bootstrap/errors.php
diff options
context:
space:
mode:
Diffstat (limited to 'config/bootstrap/errors.php')
-rw-r--r--config/bootstrap/errors.php28
1 files changed, 28 insertions, 0 deletions
diff --git a/config/bootstrap/errors.php b/config/bootstrap/errors.php
new file mode 100644
index 0000000..8354478
--- /dev/null
+++ b/config/bootstrap/errors.php
@@ -0,0 +1,28 @@
+<?php
+/**
+ * Lithium: the most rad php framework
+ *
+ * @copyright Copyright 2011, Union of RAD (http://union-of-rad.org)
+ * @license http://opensource.org/licenses/bsd-license.php The BSD License
+ */
+
+use lithium\core\ErrorHandler;
+use lithium\action\Response;
+use lithium\net\http\Media;
+
+ErrorHandler::apply('lithium\action\Dispatcher::run', array(), function($info, $params) {
+ $response = new Response(array(
+ 'request' => $params['request'],
+ 'status' => $info['exception']->getCode()
+ ));
+
+ Media::render($response, compact('info', 'params'), array(
+ 'controller' => '_errors',
+ 'template' => 'development',
+ 'layout' => 'error',
+ 'request' => $params['request']
+ ));
+ return $response;
+});
+
+?> \ No newline at end of file