October\Rain\Exception\ExceptionBase

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

Extends:

  • Exception

Implements:

  • Throwable

The base exception class. This class represents a base interface and set of properties for system and application exceptions.

Public properties

public string $hint

Hint Message to help the user with troubleshooting the error (optional).

Protected properties

protected Exception $mask

If this exception is acting as a mask, this property stores the face exception.

protected array $fileContent

File content relating to the exception, each value of the array is a file line number.

protected string $className

Class name of the called Exception.

protected string $errorType

Error type derived from the error code. Will be 'Undefined' if no code is used.

protected stdObject $highlight

Cached code information for highlighting code.

Show inherited protected properties

Inherited protected properties

  • protected $message - defined in Exception.
  • protected $code - defined in Exception.
  • protected $file - defined in Exception.
  • protected $line - defined in Exception.

Public methods

public void __construct(string $message='', int $code=0, Exception $previous=NULL)

CMS base exception class constructor. Inherits the native PHP Exception. All CMS related classes should inherit this class, it creates a set of unified properties and an interface for displaying the CMS exception page.

Parameters
  • string $message - Error message.
  • int $code - Error code.
  • Exception $previous - Previous exception.

public void applyMask(Exception $exception)

This method is used when applying the mask exception to the face exception. It can be used as an override for child classes who may use different masking logic.

Parameters
  • Exception $exception - Face exception being masked.

public Array getCallStack()

Returns the call stack as an array of values containing a stack information object.

public string getClassName()

Returns the class name of the called Exception.

public string getErrorType()

Returns the error type derived from the error code used.

public array getHighlight()

Generates information used for highlighting the area of code in context of the exception line number. The highlighted block of code will be six (6) lines before and after the problem line number.

public array getHighlightLines()

Returns an array of line numbers used for highlighting the problem area of code. This will be six (6) lines before and after the error line number.

public Exception getTrueException()

If this exception is acting as a mask, return the face exception. Otherwise return this exception as the true one.

public static void mask(string $message=NULL, int $code=0)

Masks an exception with the called class. This should catch fatal and php errors. It should always be followed by the unmask() method to remove the mask.

Parameters
  • string $message - Error message.
  • int $code - Error code.

public void setMask(Exception $exception)

If this exception acts as a mask, sets the face for the foreign exception.

Parameters
  • Exception $exception - Face for the mask, the underlying exception.

public static void unmask()

Removes the active mask from the called class.

Show inherited public methods

Inherited public methods

  • public void __toString() - defined in Exception.
  • public void __wakeup() - defined in Exception.
  • public void getCode() - defined in Exception.
  • public void getFile() - defined in Exception.
  • public void getLine() - defined in Exception.
  • public void getMessage() - defined in Exception.
  • public void getPrevious() - defined in Exception.
  • public void getTrace() - defined in Exception.
  • public void getTraceAsString() - defined in Exception.

Protected methods

protected array filterCallStack(array $traceInfo)

Removes the final steps of a call stack, which add no value for the user. The following exceptions and any trace information afterwards will be filtered:

  • Illuminate\Foundation\Bootstrap\HandleExceptions
Parameters
  • array $traceInfo - The trace information from getTrace() or debug_backtrace().

protected string formatStackArguments(array $arguments)

Prepares a function or method argument list for display in HTML or text format

Parameters
  • array $arguments - A list of the function or method arguments