api: Use JsonResponse in the ErrorController

refs #9606
This commit is contained in:
Eric Lippmann 2015-09-07 13:37:00 +02:00
parent f467d085b0
commit 26d1a04e48
1 changed files with 4 additions and 5 deletions

View File

@ -3,6 +3,7 @@
namespace Icinga\Controllers; namespace Icinga\Controllers;
use Icinga\Web\Response\JsonResponse;
use Zend_Controller_Plugin_ErrorHandler; use Zend_Controller_Plugin_ErrorHandler;
use Icinga\Application\Icinga; use Icinga\Application\Icinga;
use Icinga\Application\Logger; use Icinga\Application\Logger;
@ -86,11 +87,9 @@ class ErrorController extends ActionController
} }
if ($this->getRequest()->isApiRequest()) { if ($this->getRequest()->isApiRequest()) {
// @TODO(el): Use ApiResponse class for unified response handling. $this->getResponse()->json()
$this->getResponse()->sendJson(array( ->setErrorMessage($this->view->message)
'status' => 'error', ->sendResponse();
'message' => $this->view->message
));
} }
$this->view->request = $error->request; $this->view->request = $error->request;