W3cubDocs

/Symfony 4.1

ExceptionController

class ExceptionController

ExceptionController renders error or exception pages for a given FlattenException.

Properties

protected $twig
protected $debug

Methods

__construct(Environment $twig, bool $debug)
Response showAction(Request $request, FlattenException $exception, DebugLoggerInterface $logger = null)

Converts an Exception to a Response.

string getAndCleanOutputBuffering(int $startObLevel)
string findTemplate(Request $request, string $format, int $code, bool $showException)
templateExists($template)

Details

__construct(Environment $twig, bool $debug)

Parameters

Environment $twig
bool $debug Show error (false) or exception (true) pages by default

Response showAction(Request $request, FlattenException $exception, DebugLoggerInterface $logger = null)

Converts an Exception to a Response.

A "showException" request parameter can be used to force display of an error page (when set to false) or the exception page (when true). If it is not present, the "debug" value passed into the constructor will be used.

Parameters

Request $request
FlattenException $exception
DebugLoggerInterface $logger

Return Value

Response

Exceptions

InvalidArgumentException When the exception template does not exist

protected string getAndCleanOutputBuffering(int $startObLevel)

Parameters

int $startObLevel

Return Value

string

protected string findTemplate(Request $request, string $format, int $code, bool $showException)

Parameters

Request $request
string $format
int $code An HTTP response status code
bool $showException

Return Value

string

protected templateExists($template)

Parameters

$template

© 2004–2017 Fabien Potencier
Licensed under the MIT License.
https://api.symfony.com/4.1/Symfony/Bundle/TwigBundle/Controller/ExceptionController.html