lib: Add Controller::httpBadRequest() for responding w/ HTTP 400 immideately
refs #9606
This commit is contained in:
parent
30add41572
commit
ec390d7a8b
|
@ -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
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue