mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-25 23:04:51 +02:00
parent
dd23bd9397
commit
e914b733cd
@ -14,6 +14,9 @@ use Icinga\Web\Controller\ActionController;
|
|||||||
*/
|
*/
|
||||||
class ErrorController extends ActionController
|
class ErrorController extends ActionController
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
protected $requiresAuthentication = false;
|
protected $requiresAuthentication = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -23,7 +26,7 @@ class ErrorController extends ActionController
|
|||||||
{
|
{
|
||||||
$error = $this->_getParam('error_handler');
|
$error = $this->_getParam('error_handler');
|
||||||
$exception = $error->exception;
|
$exception = $error->exception;
|
||||||
|
/** @var \Exception $exception */
|
||||||
Logger::error($exception);
|
Logger::error($exception);
|
||||||
Logger::error('Stacktrace: %s', $exception->getTraceAsString());
|
Logger::error('Stacktrace: %s', $exception->getTraceAsString());
|
||||||
|
|
||||||
@ -74,6 +77,15 @@ class ErrorController extends ActionController
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($this->getRequest()->getIsApiRequest()) {
|
||||||
|
// @TODO(el): Use ApiResponse class for unified response handling.
|
||||||
|
$this->getRequest()->sendJson(array(
|
||||||
|
'status' => 'error',
|
||||||
|
'message' => $this->view->message
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
$this->view->request = $error->request;
|
$this->view->request = $error->request;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user