From 03b4de32530e5b7c3822ca66129230d1debcbc5a Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Thu, 21 May 2015 16:56:27 +0200 Subject: [PATCH] Handle the HttpNotFoundException in the ErrorController refs #6281 --- application/controllers/ErrorController.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/application/controllers/ErrorController.php b/application/controllers/ErrorController.php index a77d36f4f..ba9b44266 100644 --- a/application/controllers/ErrorController.php +++ b/application/controllers/ErrorController.php @@ -3,6 +3,7 @@ use Icinga\Application\Icinga; use Icinga\Application\Logger; +use Icinga\Exception\HttpNotFoundException; use Icinga\Exception\MissingParameterException; use Icinga\Security\SecurityException; use Icinga\Web\Controller\ActionController; @@ -45,8 +46,8 @@ class ErrorController extends ActionController break; default: switch (true) { - case $exception instanceof SecurityException: - $this->getResponse()->setHttpResponseCode(403); + case $exception instanceof HttpNotFoundException: + $this->getResponse()->setHttpResponseCode(404); break; case $exception instanceof MissingParameterException: $this->getResponse()->setHttpResponseCode(400); @@ -55,6 +56,9 @@ class ErrorController extends ActionController 'Missing parameter ' . $exception->getParameter() ); break; + case $exception instanceof SecurityException: + $this->getResponse()->setHttpResponseCode(403); + break; default: $this->getResponse()->setHttpResponseCode(500); break;