ErrorHandler

System Error Handler, this class handles application exception events.

 class System\Classes\ErrorHandler
extends Winter\Storm\Exception\ErrorHandler

Properties

protected static $activeMask : Throwable | null

Inherited from ErrorHandler

A prepared mask exception used to mask any exception fired.

protected static $maskLayers : array

Inherited from ErrorHandler

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

Methods

public 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.

Returns
mixed

Error page contents.

public handleDetailedError ($exception) : View

Displays the detailed system exception page.

Parameters
Property Description
$exception
mixed
Returns
View

Object containing the error page.

public static applyMask (Throwable $exception) : void

Inherited from ErrorHandler

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

Parameters
Property Description
$exception
Throwable

The mask exception.

Returns
void

public beforeHandleError ($exception) : void

Inherited from ErrorHandler

We are about to display an error page to the user, provide an opportunity to handle extra functions.

Parameters
Property Description
$exception
mixed
Returns
void

public static getDetailedMessage (Throwable $exception) : string

Inherited from ErrorHandler

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

Parameters
Property Description
$exception
Throwable
Returns
string

public handleException (Throwable $proposedException) : mixed

Inherited from ErrorHandler

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.

Parameters
Property Description
$proposedException
Throwable

The exception candidate that has been thrown.

Returns
mixed

Error page contents

public static removeMask () : void

Inherited from ErrorHandler

Destroys the prepared mask by applyMask()

Returns
void
Copyright © 2024 Winter CMS