diff --git a/application/controllers/ErrorController.php b/application/controllers/ErrorController.php index 07bb5dff4..684758348 100644 --- a/application/controllers/ErrorController.php +++ b/application/controllers/ErrorController.php @@ -86,9 +86,22 @@ class ErrorController extends ActionController Logger::error("%s\n%s", $exception, $exception->getTraceAsString()); break; } - $this->view->message = $exception->getMessage(); + + $this->view->messages = array(); + if ($this->getInvokeArg('displayExceptions')) { - $this->view->stackTrace = $exception->getTraceAsString(); + $this->view->stackTraces = array(); + + do { + $this->view->messages[] = $exception->getMessage(); + $this->view->stackTraces[] = $exception->getTraceAsString(); + $exception = $exception->getPrevious(); + } while ($exception !== null); + } else { + do { + $this->view->messages[] = $exception->getMessage(); + $exception = $exception->getPrevious(); + } while ($exception !== null); } break; diff --git a/application/views/scripts/error/error.phtml b/application/views/scripts/error/error.phtml index 1e0c29b0e..2dd87ee34 100644 --- a/application/views/scripts/error/error.phtml +++ b/application/views/scripts/error/error.phtml @@ -4,9 +4,17 @@
-

escape($message)) ?>

- -
-
escape($stackTrace) ?>
- + $message) { + echo '

' . nl2br($this->escape($message)) . '

' + . '
' + . '
' . $this->escape($stackTraces[$i]) . '
'; + } +} else { + foreach ($messages as $message) { + echo '

' . nl2br($this->escape($message)) . '

'; + } +} +?>