Add shortcuts to ErrorsController

This commit is contained in:
Giuseppe Criscione 2024-10-24 00:52:34 +02:00
parent 4cdeb99192
commit f5ab91a42d

View File

@ -37,4 +37,19 @@ class ErrorsController extends AbstractController implements ErrorsControllerInt
return $response;
}
public function notFound(): Response
{
return $this->error(ResponseStatus::NotFound);
}
public function internalServerError(Throwable $throwable): Response
{
return $this->error(ResponseStatus::InternalServerError, $throwable);
}
public function forbidden(): Response
{
return $this->error(ResponseStatus::Forbidden);
}
}