-
Notifications
You must be signed in to change notification settings - Fork 0
API: The Exceptable Interface
Interface for exceptional exceptions.
User-provided contextual information for this exception.
This may be replacement values for error message formatting, information you want to be logged, or additional data/structures to be available to your code (e.g., for error handling). Any data types are permitted, and most will be meaningfully converted to string for message formatting. Values are not required to be serializable, but this is probably a good idea.
Key names starting with a double underscore (__
) are reserved for internal use; your keys with this prefix may be overwritten/lost. The following values will be added to your Exceptable context automatically:
- Throwable
__exception__
: the current exception. - ? Throwable
__previous__
: the previous exception, if any. - Throwable
__root__
: the original (most-previous) exception in this exception chain. This may be the same as__exception__
or__previous__
.
For each of these, the following are also available for message formatting:
- string
__{exception}Message__
: the exception/previous/root error message. - int
__{exception}Code__
: the exception/previous/root error code. - string
__{exception}File__
: the file in which the exception/previous/root occured. - int
__{exception}Line__
: the line on which the exception/previous/root occured. - ? Fault
__{exception}Fault__
: the fault that the exception/previous/root was built from, if any.
The Fault instance that this Exceptable was build from.
The previous exception, if any.
The original (most-previous) exception in this exception's chain. This may be the same as the top-level or previous exception.
Constructs a new Exceptable instance from a Fault.
- at\exceptable\Fault
$fault
The Fault to build from. - array
$context
User-provided contextual information. - Throwable
$previous
The previous exception, if any.
Checks whether this Exceptable contains the given Fault, anywhere in its exception chain.
- at\exceptable\Fault
$fault
The Fault to check for.
- boolean
Checks whether this Exceptable was built from the given Fault.
- at\exceptable\Fault
$fault
The Fault to check for.
- boolean
Inherited from Throwable:
- string
getMessage()
- int
getCode()
- string
getFile()
- int
getLine()
- array
getTrace()
- string
getTraceAsString()
- ? Throwable
getPrevious()
- string
__toString()