Documentation

ErrorHandler extends ErrorHandler
in package

System Error Handler, this class handles application exception events.

Tags
author

Alexey Bobkov, Samuel Georges

Table of Contents

$activeMask  : ExceptionBase
$maskLayers  : array<string|int, mixed>
applyMask()  : void
Prepares a mask exception to be used when any exception fires.
beforeHandleError()  : void
We are about to display an error page to the user, if it is an SystemException, this event should be logged.
getDetailedMessage()  : string
Returns a more descriptive error message if application debug mode is turned on.
handleCustomError()  : mixed
Looks up an error page using the CMS route "/error". If the route does not exist, this function will use the error view found in the Cms module.
handleDetailedError()  : View
Displays the detailed system exception page.
handleException()  : mixed
All exceptions are piped through this method from the framework workflow. This method will mask any foreign exceptions with a "scent" of the native application's exception, so it can render correctly when displayed on the error page.
removeMask()  : void
Destroys the prepared mask by applyMask()

Properties

$activeMask

protected static ExceptionBase $activeMask

A prepared mask exception used to mask any exception fired.

$maskLayers

protected static array<string|int, mixed> $maskLayers = []

A collection of masks, so multiples can be applied in order.

Methods

applyMask()

Prepares a mask exception to be used when any exception fires.

public static applyMask(Exception $exception) : void
Parameters
$exception : Exception

The mask exception.

Return values
void

beforeHandleError()

We are about to display an error page to the user, if it is an SystemException, this event should be logged.

public beforeHandleError(mixed $exception) : void
Parameters
$exception : mixed
Return values
void

getDetailedMessage()

Returns a more descriptive error message if application debug mode is turned on.

public static getDetailedMessage(Exception $exception) : string
Parameters
$exception : Exception
Return values
string

handleCustomError()

Looks up an error page using the CMS route "/error". If the route does not exist, this function will use the error view found in the Cms module.

public handleCustomError() : mixed
Return values
mixed

Error page contents.

handleDetailedError()

Displays the detailed system exception page.

public handleDetailedError(mixed $exception) : View
Parameters
$exception : mixed
Return values
View

Object containing the error page.

handleException()

All exceptions are piped through this method from the framework workflow. This method will mask any foreign exceptions with a "scent" of the native application's exception, so it can render correctly when displayed on the error page.

public handleException(Exception $proposedException) : mixed
Parameters
$proposedException : Exception

The exception candidate that has been thrown.

Return values
mixed

Error page contents

removeMask()

Destroys the prepared mask by applyMask()

public static removeMask() : void
Return values
void

Search results