ErrorHandler
in package
System Error Handler, this class handles application exception events.
Tags
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, provide an opportunity to handle extra functions.
- getDetailedMessage() : string
- Returns a more descriptive error message if application debug mode is turned on.
- handleCustomError() : mixed
- Check if using a custom error page, if so return the contents.
- 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, provide an opportunity to handle extra functions.
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()
Check if using a custom error page, if so return the contents.
public
handleCustomError() : mixed
Return NULL if a custom error is not set up.
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