DebugExceptionHandler
class DebugExceptionHandler extends AbstractExceptionHandler (View source)
A basic but solid exception handler which catches everything which falls through the other exception handlers and provides useful debugging information.
Properties
protected LoggerInterface | $logger | from AbstractExceptionHandler | |
protected ThrowableStorageInterface | $throwableStorage | from AbstractExceptionHandler | |
protected array | $options | from AbstractExceptionHandler | |
protected | $renderingOptions | Merged custom error view options from defaultRenderingOptions and of the first matching renderingGroup |
from AbstractExceptionHandler |
protected string | $htmlExceptionTemplate | The template for the HTML Exception output. |
Methods
Sets options of this exception handler.
Constructs this exception handler - registers itself as the default exception handler.
Sets legacy "option" properties to the view for backwards compatibility.
Checks if custom rendering rules apply to the given $exception and returns those.
If a renderingGroup was successfully resolved via resolveRenderingGroup We will use a custom error view.
Formats and echoes the exception and its previous exceptions (if any) for the command line
Renders a single exception including message, code and affected file
Renders the given $value word-wrapped and prefixed with $label
Splits the given string into subject and body according to following rules:
- If the string is empty or does not contain more than one sentence nor line breaks, the subject will be equal to the string and body will be an empty string
- Otherwise the subject is everything until the first line break or end of sentence, the body contains the rest
Returns the statically rendered exception message
Details
void
injectLogger(LoggerInterface $logger)
No description
injectThrowableStorage(ThrowableStorageInterface $throwableStorage)
No description
void
setOptions(array $options)
Sets options of this exception handler.
__construct()
Constructs this exception handler - registers itself as the default exception handler.
void
handleException(object $exception)
Handles the given exception
protected void
echoExceptionWeb(Throwable $exception)
Formats and echoes the exception as XHTML.
protected ViewInterface
buildView(Throwable $exception, array $renderingOptions)
Prepares a view for rendering the custom error page.
protected ViewInterface
applyLegacyViewOptions(ViewInterface $view, array $renderingOptions)
Sets legacy "option" properties to the view for backwards compatibility.
protected array
resolveCustomRenderingOptions(Throwable $exception)
Checks if custom rendering rules apply to the given $exception and returns those.
protected string
resolveRenderingGroup(Throwable $exception)
No description
protected bool
useCustomErrorView()
If a renderingGroup was successfully resolved via resolveRenderingGroup We will use a custom error view.
Also check for legacy 'templatePathAndFilename'
protected void
echoExceptionCli(Throwable $exception)
Formats and echoes the exception and its previous exceptions (if any) for the command line
protected string
renderNestedExceptonsCli(Throwable $exception, string $exceptionMessage)
No description
protected string
renderSingleExceptionCli(Throwable $exception)
Renders a single exception including message, code and affected file
protected string
renderExceptionDetailCli(string $label, string $value)
Renders the given $value word-wrapped and prefixed with $label
protected array
splitExceptionMessage(string $exceptionMessage)
Splits the given string into subject and body according to following rules:
- If the string is empty or does not contain more than one sentence nor line breaks, the subject will be equal to the string and body will be an empty string
- Otherwise the subject is everything until the first line break or end of sentence, the body contains the rest
protected void
renderStatically(int $statusCode, Throwable $exception)
Returns the statically rendered exception message