class ExceptionHandler extends ExceptionHandler
deprecated
ExceptionHandler converts an exception to a Response object.
__construct($debug = true, $charset = null, $fileLinkFormat = null) | from ExceptionHandler | |
static ExceptionHandler | register(bool $debug = true, string|null $charset = null, string|null $fileLinkFormat = null) Registers the exception handler. | from ExceptionHandler |
callable|null | setHandler(callable $handler) Sets a user exception handler. | from ExceptionHandler |
string | setFileLinkFormat(string $format) Sets the format for links to source files. | from ExceptionHandler |
handle(Exception $exception) Sends a response for the given Exception. | from ExceptionHandler | |
sendPhpResponse(Exception|FlattenException $exception) Sends the error associated with the given Exception as a plain PHP response. | from ExceptionHandler | |
Response | createResponse(Exception|FlattenException $exception) deprecated Creates the error Response associated with the given Exception. | from ExceptionHandler |
string | getHtml(Exception|FlattenException $exception) Gets the full HTML content associated with the given exception. | from ExceptionHandler |
string | getContent(FlattenException $exception) Gets the HTML content associated with the given exception. | from ExceptionHandler |
string | getStylesheet(FlattenException $exception) Gets the stylesheet associated with the given exception. | from ExceptionHandler |
catchOutput($buffer) | from ExceptionHandler | |
cleanOutput($buffer) | from ExceptionHandler |
$debug | ||
$charset | ||
$fileLinkFormat |
Registers the exception handler.
bool | $debug | Enable/disable debug mode, where the stack trace is displayed |
string|null | $charset | The charset used by exception messages |
string|null | $fileLinkFormat | The IDE link template |
ExceptionHandler | The registered exception handler |
Sets a user exception handler.
callable | $handler | An handler that will be called on Exception |
callable|null | The previous exception handler if any |
Sets the format for links to source files.
string | $format | The format for links to source files |
string | The previous file link format. |
Sends a response for the given Exception.
To be as fail-safe as possible, the exception is first handled by our simple exception handler, then by the user exception handler. The latter takes precedence and any output from the former is cancelled, if and only if nothing bad happens in this handling path.
Exception | $exception |
Sends the error associated with the given Exception as a plain PHP response.
This method uses plain PHP functions like header() and echo to output the response.
Exception|FlattenException | $exception | An \Exception or FlattenException instance |
deprecated
Creates the error Response associated with the given Exception.
Exception|FlattenException | $exception | An \Exception or FlattenException instance |
Response | A Response instance |
Gets the full HTML content associated with the given exception.
Exception|FlattenException | $exception | An \Exception or FlattenException instance |
string | The HTML content as a string |
Gets the HTML content associated with the given exception.
FlattenException | $exception | A FlattenException instance |
string | The content as a string |
Gets the stylesheet associated with the given exception.
FlattenException | $exception | A FlattenException instance |
string | The stylesheet as a string |
$buffer |
$buffer |
© 2004–2017 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/4.0/Symfony/Component/HttpKernel/Debug/ExceptionHandler.html