Cms\Classes\CmsException

Source: ~/modules/cms/classes/CmsException.php

Extends:

Implements:

  • Throwable

The CMS exception class. The exception class handles CMS related errors. Allows the masking of other exception types which uses actual source CMS files — instead of cached files — for their error content.

Public properties

There are no public properties in the class.

Show inherited public properties

Inherited public properties

Protected properties

protected Cms\Classes\CmsCompoundObject $compoundObject

A reference to a CMS object used for masking errors.

protected static array $errorCodes

Collection of error codes for each error distinction.

Show inherited protected properties

Inherited protected properties

Public methods

public void __construct(mixed $message=NULL, int $code=100, Exception $previous=NULL)

Creates the CMS exception object.

Parameters
  • mixed $message - The message to display as a string, or a CmsCompoundObject that is used for using this exception as a mask for another exception type.
  • int $code - Error code to specify the exception type: Error 100: A general exception. Error 200: Mask the exception as INI content. Error 300: Mask the exception as PHP content. Error 400: Mask the exception as Twig content.
  • Exception $previous - Previous exception.

public void applyMask(Exception $exception)

Masks this exception with the details of the supplied. The error code for this exception object will determine how the supplied exception is used. Error 100: A general exception. Inherits \System\Classes\ExceptionBase::applyMask() Error 200: Mask the exception as INI content. Error 300: Mask the exception as PHP content. Error 400: Mask the exception as Twig content.

Parameters
  • Exception $exception - The exception to modify.

public bool processCompoundObject(Exception $exception)

Checks some conditions to confirm error has actually occurred due to the CMS template code, not some external code. If the error has occurred in external code, the function will return false. Otherwise return true and modify the exception by overriding it's content, line and message values to be accurate against a CMS object properties.

Parameters
  • Exception $exception - The exception to modify.

Show inherited public methods

Inherited public methods

  • public void __toString() - defined in Exception.
  • public void __wakeup() - defined in Exception.
  • public Array getCallStack() - defined in October\Rain\Exception\ExceptionBase. Returns the call stack as an array of values containing a stack information object.
  • public string getClassName() - defined in October\Rain\Exception\ExceptionBase. Returns the class name of the called Exception.
  • public void getCode() - defined in Exception.
  • public string getErrorType() - defined in October\Rain\Exception\ExceptionBase. Returns the error type derived from the error code used.
  • public void getFile() - defined in Exception.
  • public array getHighlight() - defined in October\Rain\Exception\ExceptionBase. Generates information used for highlighting the area of code in context of the exception line number.
  • public array getHighlightLines() - defined in October\Rain\Exception\ExceptionBase. Returns an array of line numbers used for highlighting the problem area of code.
  • 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.
  • public Exception getTrueException() - defined in October\Rain\Exception\ExceptionBase. If this exception is acting as a mask, return the face exception. Otherwise return.
  • public static void mask(string $message=NULL, int $code=0) - defined in October\Rain\Exception\ExceptionBase. Masks an exception with the called class. This should catch fatal and php errors.
  • public void setMask(Exception $exception) - defined in October\Rain\Exception\ExceptionBase. If this exception acts as a mask, sets the face for the foreign exception.
  • public static void unmask() - defined in October\Rain\Exception\ExceptionBase. Removes the active mask from the called class.

Protected methods

protected bool processIni(Exception $exception)

Override properties of an exception specific to the INI section of a CMS object.

Parameters
  • Exception $exception - The exception to modify.

protected bool processPhp(Exception $exception)

Override properties of an exception specific to the PHP section of a CMS object.

Parameters
  • Exception $exception - The exception to modify.

protected bool processTwig(Exception $exception)

Override properties of an exception specific to the Twig section of a CMS object.

Parameters
  • Exception $exception - The exception to modify.

Show inherited protected methods

Inherited protected methods

  • protected array filterCallStack(array $traceInfo) - defined in October\Rain\Exception\ExceptionBase. Removes the final steps of a call stack, which add no value for the user.
  • protected string formatStackArguments(array $arguments) - defined in October\Rain\Exception\ExceptionBase. Prepares a function or method argument list for display in HTML or text format.