lib: Add Controller::httpBadRequest() for responding w/ HTTP 400 immideately

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

View File

@ -6,6 +6,7 @@ namespace Icinga\Web;
use Icinga\Data\Filterable;
use Icinga\Data\Sortable;
use Icinga\Data\QueryInterface;
use Icinga\Exception\Http\HttpBadRequestException;
use Icinga\Exception\Http\HttpNotFoundException;
use Icinga\Web\Controller\ModuleActionController;
use Icinga\Web\Widget\Limiter;
@ -51,6 +52,19 @@ class Controller extends ModuleActionController
}
}
/**
* Immediately respond w/ HTTP 400
*
* @param string $message Exception message or exception format string
* @param mixed ...$arg Format string argument
*
* @throws HttpBadRequestException
*/
public function httpBadRequest($message)
{
throw HttpBadRequestException::create(func_get_args());
}
/**
* Immediately respond w/ HTTP 404
*