Cms\Classes\CmsException

Overview

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

Extends
Implements
  • Stringable
  • Throwable

Public Properties

There are no public properties in the class.

Show inherited public properties

Inherited Public Properties

Protected Properties

protected Cms\Contracts\CmsObject $cmsObject

compoundObject used for masking errors.

protected static array $errorCodes

errorCodes for each error distinction.

Show inherited protected properties

Inherited Protected Properties


Public Methods

public __construct()

public __construct(
    mixed $message = null,
    int $code = 100,
    Throwable $previous = null
): void

__construct the CMS exception object.

public applyMask()

public applyMask(Throwable $exception): void 

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

public processCompoundObject()

public processCompoundObject(Throwable $exception): bool 

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

Show inherited public methods

Inherited Public Methods

Protected Methods

protected processIni()

protected processIni(Throwable $exception): bool 

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

protected processPhp()

protected processPhp(Throwable $exception): bool 

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

protected processTwig()

protected processTwig(Throwable $exception): bool 

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

Show inherited protected methods

Inherited Protected Methods