Skip to content

Commit

Permalink
Handle the HttpNotFoundException in the ErrorController
Browse files Browse the repository at this point in the history
refs #6281
  • Loading branch information
lippserd committed May 21, 2015
1 parent dd10251 commit 03b4de3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions application/controllers/ErrorController.php
Expand Up @@ -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;
Expand Down Expand Up @@ -45,8 +46,8 @@ public function errorAction()
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);
Expand All @@ -55,6 +56,9 @@ public function errorAction()
'Missing parameter ' . $exception->getParameter()
);
break;
case $exception instanceof SecurityException:
$this->getResponse()->setHttpResponseCode(403);
break;
default:
$this->getResponse()->setHttpResponseCode(500);
break;
Expand Down

0 comments on commit 03b4de3

Please sign in to comment.