285. Class

285.1. Zend\Mvc\View\Console\ExceptionStrategy

285.1.1. Methods

285.1.1.1. attach

attach()

Attach the aggregate to the specified event manager

Parameters:EventManagerInterface
Return type:void

285.1.1.2. detach

detach()

Detach aggregate listeners from the specified event manager

Parameters:EventManagerInterface
Return type:void

285.1.1.3. setDisplayExceptions

setDisplayExceptions()

Flag: display exceptions in error pages?

Parameters:bool
Return type:ExceptionStrategy

285.1.1.4. displayExceptions

displayExceptions()

Should we display exceptions in error pages?

Return type:bool

285.1.1.5. getMessage

getMessage()

Get current template for message that will be shown in Console.

Return type:string

285.1.1.6. setMessage

setMessage()

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
Parameters:string|callable
Return type:ExceptionStrategy

285.1.1.7. prepareExceptionViewModel

prepareExceptionViewModel()

Create an exception view model, and set the HTTP status code

Parameters:MvcEvent
Return type:void