parent
6ef87f4644
commit
4473008d65
|
@ -42,26 +42,23 @@ class ErrorController extends ActionController
|
||||||
*/
|
*/
|
||||||
public function errorAction()
|
public function errorAction()
|
||||||
{
|
{
|
||||||
$errors = $this->_getParam('error_handler');
|
$error = $this->_getParam('error_handler');
|
||||||
switch ($errors->type) {
|
switch ($error->type) {
|
||||||
case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ROUTE:
|
case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ROUTE:
|
||||||
case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER:
|
case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER:
|
||||||
case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION:
|
case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION:
|
||||||
// 404 error -- controller or action not found
|
|
||||||
$this->getResponse()->setHttpResponseCode(404);
|
$this->getResponse()->setHttpResponseCode(404);
|
||||||
$this->view->message = 'Page not found';
|
$this->view->message = 'Page not found';
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
// application error
|
|
||||||
$this->getResponse()->setHttpResponseCode(500);
|
$this->getResponse()->setHttpResponseCode(500);
|
||||||
$this->view->message = 'Application error';
|
$this->view->message = $error->exception->getMessage();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// conditionally display exceptions
|
|
||||||
if ($this->getInvokeArg('displayExceptions') == true) {
|
if ($this->getInvokeArg('displayExceptions') == true) {
|
||||||
$this->view->exception = $errors->exception;
|
$this->view->stackTrace = $error->exception->getTraceAsString();
|
||||||
}
|
}
|
||||||
$this->view->request = $errors->request;
|
$this->view->request = $error->request;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// @codingStandardsIgnoreEnd
|
// @codingStandardsIgnoreEnd
|
||||||
|
|
|
@ -1,9 +1,12 @@
|
||||||
<?= $this->tabs->render($this); ?>
|
<?= $this->tabs->render($this); ?>
|
||||||
|
<div class="alert alert-danger">
|
||||||
<div class="alert alert-error">
|
<p><?= $message ?></p>
|
||||||
<h1>An error occurred</h1>
|
</div>
|
||||||
|
<?php if (isset($stackTrace)) : ?>
|
||||||
<?php if (isset($this->messageBox)) : ?>
|
<hr />
|
||||||
<?= $this->messageBox->render() ?>
|
<pre><?= $stackTrace ?></pre>
|
||||||
<? endif ?>
|
<?php endif ?>
|
||||||
|
<?php if (isset($this->messageBox)) : ?>
|
||||||
|
<?= $this->messageBox->render(); ?>
|
||||||
|
<? endif ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue