PHP Class Neos\Flow\Error\AbstractExceptionHandler

Inheritance: implements Neos\Flow\Error\ExceptionHandlerInterface
ファイルを表示 Open project: neos/flow-development-collection

Protected Properties

Property Type Description
$options array
$renderingOptions array
$systemLogger Neos\Flow\Log\SystemLoggerInterface

Public Methods

Method Description
__construct ( ) Constructs this exception handler - registers itself as the default exception handler.
handleException ( object $exception ) : void Handles the given exception
injectSystemLogger ( Neos\Flow\Log\SystemLoggerInterface $systemLogger ) : void Injects the system logger
setOptions ( array $options ) : void Sets options of this exception handler.

Protected Methods

Method Description
applyLegacyViewOptions ( Neos\Flow\Mvc\View\ViewInterface $view, array $renderingOptions ) : Neos\Flow\Mvc\View\ViewInterface Sets legacy "option" properties to the view for backwards compatibility.
buildView ( object $exception, array $renderingOptions ) : Neos\Flow\Mvc\View\ViewInterface Prepares a Fluid view for rendering the custom error page.
echoExceptionCli ( object $exception ) : void Formats and echoes the exception and its previous exceptions (if any) for the command line
echoExceptionWeb ( object $exception ) : void Echoes an exception for the web.
renderExceptionDetailCli ( string $label, string $value ) : string Renders the given $value word-wrapped and prefixed with $label
renderSingleExceptionCli ( object $exception ) : string Renders a single exception including message, code and affected file
resolveCustomRenderingOptions ( object $exception ) : array Checks if custom rendering rules apply to the given $exception and returns those.
resolveRenderingGroup ( object $exception ) : string
splitExceptionMessage ( string $exceptionMessage ) : array 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

Method Details

__construct() public method

Constructs this exception handler - registers itself as the default exception handler.
public __construct ( )

applyLegacyViewOptions() protected method

Sets legacy "option" properties to the view for backwards compatibility.
protected applyLegacyViewOptions ( Neos\Flow\Mvc\View\ViewInterface $view, array $renderingOptions ) : Neos\Flow\Mvc\View\ViewInterface
$view Neos\Flow\Mvc\View\ViewInterface
$renderingOptions array
return Neos\Flow\Mvc\View\ViewInterface

buildView() protected method

Prepares a Fluid view for rendering the custom error page.
protected buildView ( object $exception, array $renderingOptions ) : Neos\Flow\Mvc\View\ViewInterface
$exception object \Exception or \Throwable
$renderingOptions array Rendering options as defined in the settings
return Neos\Flow\Mvc\View\ViewInterface

echoExceptionCli() protected method

Formats and echoes the exception and its previous exceptions (if any) for the command line
protected echoExceptionCli ( object $exception ) : void
$exception object \Exception or \Throwable
return void

echoExceptionWeb() abstract protected method

Echoes an exception for the web.
abstract protected echoExceptionWeb ( object $exception ) : void
$exception object \Exception or \Throwable
return void

handleException() public method

Handles the given exception
public handleException ( object $exception ) : void
$exception object The exception object - can be \Exception, or some type of \Throwable in PHP 7
return void

injectSystemLogger() public method

Injects the system logger
public injectSystemLogger ( Neos\Flow\Log\SystemLoggerInterface $systemLogger ) : void
$systemLogger Neos\Flow\Log\SystemLoggerInterface
return void

renderExceptionDetailCli() protected method

Renders the given $value word-wrapped and prefixed with $label
protected renderExceptionDetailCli ( string $label, string $value ) : string
$label string
$value string
return string

renderSingleExceptionCli() protected method

Renders a single exception including message, code and affected file
protected renderSingleExceptionCli ( object $exception ) : string
$exception object \Exception or \Throwable
return string

resolveCustomRenderingOptions() protected method

Checks if custom rendering rules apply to the given $exception and returns those.
protected resolveCustomRenderingOptions ( object $exception ) : array
$exception object \Exception or \Throwable
return array the custom rendering options, or NULL if no custom rendering is defined for this exception

resolveRenderingGroup() protected method

protected resolveRenderingGroup ( object $exception ) : string
$exception object \Exception or \Throwable
return string name of the resolved renderingGroup or NULL if no group could be resolved

setOptions() public method

Sets options of this exception handler.
public setOptions ( array $options ) : void
$options array Options for the exception handler
return void

splitExceptionMessage() protected method

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 splitExceptionMessage ( string $exceptionMessage ) : array
$exceptionMessage string
return array in the format array('subject' => '', 'body' => '');

Property Details

$options protected_oe property

protected array $options
return array

$renderingOptions protected_oe property

protected array $renderingOptions
return array

$systemLogger protected_oe property

protected SystemLoggerInterface,Neos\Flow\Log $systemLogger
return Neos\Flow\Log\SystemLoggerInterface