API Documentation for: 1.1.1
Show:

CanteenError Class

Extends Exception
Namespace: Canteen\Errors

Canteen errors are exceptions which are only visible in debug mode. These are site critical things like setup is wrong. Located in the namespace Canteen\Errors.

Constructor

CanteenError

(
  • code
  • [data='']
  • [messages=null]
)

Parameters:

  • code Int

    The code number

  • [data=''] String | Array optional

    Any extra data associated with error

  • [messages=null] Dictionary optional

    The collection of messages to lookup

Methods

convertToResult

(
  • e
)
Dictionary static

A utility function to convert any exception to formatted result

Parameters:

  • e Exception

    The exception to convert to better formatted result

Returns:

Dictionary:

The result Exception object formatted nicely

getFormattedTrace

(
  • e
)
Array protected static

A utility function to formatted the exception stack trace

Parameters:

  • e Exception

    The exception to convert to trace

Returns:

Array:

The collection of arrays

getResult

() Dictionary

Get the result object

Returns:

Dictionary:

The result Exception object formatted nicely

Properties

AUTOLOAD_CLASS

Int final static

Duplicate named autoload class

FORM_INHERITANCE

Int final static

The form inheritance is wrong

INSUFFICIENT_PHP

Int final static

PHP version check failed

INSUFFICIENT_VERSION

Int final static

Canteen version is unsufficient

INTERNAL_ONLY

Int final static

The method being called is for internal use only

INVALID_CLASS

Int final static

The class doesn't exist

INVALID_DATA

Int final static

A particular data name is referenced but doesn exist

INVALID_FORM

Int final static

The form specified does not exist

INVALID_INDEX

Int final static

The specified site index doesn't exist

INVALID_PROPERTY

Int final static

Property doesn't exist on the class

INVALID_SERVICE_ALIAS

Int final static

Trying to access service($alias) and nothing can be created

messages

Array private final static

The collection of messages

NO_SETTINGS

Int final static

No settings were found for a matching domain

OVERRIDE_CONTROLLER_PROCESS

Int final static

Bad controller implementation

rootPath

String static

The source directory path to Canteen folder, this is used to remove the verbose path to Canteen

SETTING_DELETE

Int final static

Unable to delete the setting

SETTING_NAME_TAKEN

Int final static

The setting name is already taken

SETTING_WRITEABLE

Int final static

Unable to change the setting

SETTINGS_REQUIRED

Int final static

The settings are required for setup

TAKEN_SERVICE_ALIAS

Int final static

Duplicate named service alias

UNKNOWN

Int final static

The label for an error that is unknown or unfound in messages

WRONG_DOMAIN

Int final static

Submitted from the wrong domain