October\Rain\Exception\ErrorHandler

Source: ~/vendor/october/rain/src/Exception/ErrorHandler.php

System Error Handler, this class handles application exception events.

Protected properties

protected static System\Classes\ExceptionBase $activeMask

A prepared mask exception used to mask any exception fired.

protected static array $maskLayers

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

Public methods

public static void applyMask(Exception $exception)

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

Parameters
  • Exception $exception - The mask exception.

public void beforeHandleError($exception)

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

Parameters
  • $exception

public static string getDetailedMessage(Exception $exception)

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

Parameters
  • Exception $exception

public mixed handleCustomError()

Check if using a custom error page, if so return the contents. Return NULL if a custom error is not set up.

public View handleDetailedError($exception)

Displays the detailed system exception page.

Parameters
  • $exception

public mixed handleException(Exception $proposedException)

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
  • Exception $proposedException - The exception candidate that has been thrown.

public static void removeMask()

Destroys the prepared mask by applyMask()