Skip to content
Permalink
Browse files

Only try to use CakeErrorController if AppController exists.

This fixes missing error pages when there are parse errors in
AppController.

Fixes #3850
  • Loading branch information...
markstory committed May 27, 2013
1 parent 76f4d10 commit 41e0c524f245c66e0ad077d084587e263f550572
Showing with 8 additions and 6 deletions.
  1. +8 −6 lib/Cake/Error/ExceptionRenderer.php
@@ -151,12 +151,14 @@ protected function _getController($exception) {
$response->header($exception->responseHeader());
}
try {
$controller = new CakeErrorController($request, $response);
$controller->startupProcess();
} catch (Exception $e) {
if (!empty($controller) && $controller->Components->enabled('RequestHandler')) {
$controller->RequestHandler->startup($controller);
if (class_exists('AppController')) {
try {
$controller = new CakeErrorController($request, $response);
$controller->startupProcess();
} catch (Exception $e) {
if (!empty($controller) && $controller->Components->enabled('RequestHandler')) {
$controller->RequestHandler->startup($controller);
}
}
}
if (empty($controller)) {

0 comments on commit 41e0c52

Please sign in to comment.
You can’t perform that action at this time.