Handle the HttpNotFoundException in the ErrorController

refs #6281
This commit is contained in:
Eric Lippmann 2015-05-21 16:56:27 +02:00
parent dd1025119d
commit 03b4de3253
1 changed files with 6 additions and 2 deletions

View File

@ -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;