-
Notifications
You must be signed in to change notification settings - Fork 0
API: The Fault Interface
Defines fault cases for specific error conditions.
The name of the Fault.
Normally, Faults are implemented as enums, and this property will be inherited from the enum case. If you decide to implement your Fault as a normal class, you will need to declare this property. It should be a single-word identifier (i.e., something that could be used as an enum case name), preferably using PascalCase.
This method is a proxy for Exceptable::toExceptable()
.
Gets a unique name for this Fault, in the form {fully qualified classname}.{fault name}
.
- string
The error message for this Fault, using the given context if applicable.
- array
$context
User-provided contextual information.
-
string
The formatted error message (if found and can be formatted from available context), prefixed with the Fault name.
Builds an Exceptable from this Fault, using the provided contextual information and previous exception.
- array
$context
User-provided contextual information. - Throwable
$previous
The previous exception, if any.
- Exceptable
Inherited from JsonSerializable
:
- mixed
jsonSerialize()