Fully Qualified Name: | Laminas\Mvc\Console\View\ExceptionStrategy |
Extends: | AbstractListenerAggregate |
Name | Description | Defined By |
---|---|---|
attach() | {@inheritDoc} | ExceptionStrategy |
detach() | {@inheritDoc} | AbstractListenerAggregate |
displayExceptions() | Should we display exceptions in error pages? | ExceptionStrategy |
getMessage() | Get current template for message that will be shown in Console. | ExceptionStrategy |
getPreviousMessage() | ExceptionStrategy | |
prepareExceptionViewModel() | Create an exception view model, and set the HTTP status code | ExceptionStrategy |
setDisplayExceptions() | Flag: display exceptions in error pages? | ExceptionStrategy |
setMessage() | Set template for message that will be shown in Console. | ExceptionStrategy |
setPreviousMessage() | Sets template for previous message that will be shown in Console. | ExceptionStrategy |
{@inheritDoc}
Parameter Name | Type | Description |
---|---|---|
$events | ||
$priority |
Returns:
{@inheritDoc}
Parameter Name | Type | Description |
---|---|---|
$events |
Returns:
Should we display exceptions in error pages?
Returns: bool
Get current template for message that will be shown in Console.
Returns: string
Returns: callable|string
Create an exception view model, and set the HTTP status code
Parameter Name | Type | Description |
---|---|---|
$e | \MvcEvent |
Returns: void
Flag: display exceptions in error pages?
Parameter Name | Type | Description |
---|---|---|
$displayExceptions | bool |
Returns: \ExceptionStrategy
Set template for message that will be shown in Console.
The message can be a string (template) or a callable (i.e. a closure).
The closure is expected to return a string and will be called with 2 parameters:
Exception $exception - the exception being thrown
boolean $displayExceptions - whether to display exceptions or not
If the message is a string, one can use the following template params:
:className - full class name of exception instance :message - exception message :code - exception code :file - the file where the exception has been thrown :line - the line where the exception has been thrown :stack - full exception stack
Parameter Name | Type | Description |
---|---|---|
$message | string|callable |
Returns: \ExceptionStrategy
Sets template for previous message that will be shown in Console.
Parameter Name | Type | Description |
---|---|---|
$previousMessage | string |
Returns: \ExceptionStrategy