Switch http code header on showDebug with ErrorHTTPException.

This commit is contained in:
Alexander Demidov
2012-11-13 14:03:42 +04:00
parent 5cc54e182e
commit 6a2c861a71

View File

@ -131,8 +131,12 @@ class FrontController
} catch (Exception $e) { } catch (Exception $e) {
if (Config::get('DEBUG')) { if (Config::get('DEBUG')) {
if (!headers_sent()) { if (!headers_sent()) {
if ($e instanceof ErrorHTTPException) {
header($e->getHTTPHeader());
} else {
header('HTTP/1.0 500 Internal Server Error'); header('HTTP/1.0 500 Internal Server Error');
} }
}
return ErrorHandler::showDebug($e); return ErrorHandler::showDebug($e);
} }
$layout_class = $this->getRouter()->getErrorLayout(); $layout_class = $this->getRouter()->getErrorLayout();