Handle the HttpBadRequestException in the error controller

refs #9606
This commit is contained in:
Eric Lippmann 2015-08-24 15:59:25 +02:00
parent 8329f5de22
commit 30add41572
1 changed files with 4 additions and 0 deletions

View File

@ -3,6 +3,7 @@
use Icinga\Application\Icinga;
use Icinga\Application\Logger;
use Icinga\Exception\Http\HttpBadRequestException;
use Icinga\Exception\Http\HttpMethodNotAllowedException;
use Icinga\Exception\Http\HttpNotFoundException;
use Icinga\Exception\MissingParameterException;
@ -64,6 +65,9 @@ class ErrorController extends ActionController
'Missing parameter ' . $exception->getParameter()
);
break;
case $exception instanceof HttpBadRequestException:
$this->getResponse()->setHttpResponseCode(400);
break;
case $exception instanceof SecurityException:
$this->getResponse()->setHttpResponseCode(403);
break;