ExceptionHandlerManager
Default UserFrosting application error handler.
It outputs the error message and diagnostic information in either JSON, XML, or HTML based on the Accept header.
Tags
Table of Contents
$ci | ContainerInterface | |
---|---|---|
$exceptionHandlers | ||
$displayErrorDetails | bool | |
__construct() | Constructor. | mixed |
__invoke() | Invoke error handler. | ResponseInterface |
registerHandler() | Register an exception handler for a specified exception class. | mixed |
Properties
$ci
protected
ContainerInterface
$ci
$exceptionHandlers
protected
mixed
$exceptionHandlers
= []
$displayErrorDetails
protected
bool
$displayErrorDetails
Methods
__construct()
Constructor.
public
__construct(
$ci :
ContainerInterface
[, $displayErrorDetails :
bool
= false ]
)
: mixed
Parameters
- $ci : ContainerInterface
The global container object, which holds all your services.
- $displayErrorDetails : bool = false
Set to true to display full details
Return values
mixed__invoke()
Invoke error handler.
public
__invoke(
$request :
ServerRequestInterface
, $response :
ResponseInterface
, $exception :
Throwable
)
: ResponseInterface
Parameters
- $request : ServerRequestInterface
The most recent Request object
- $response : ResponseInterface
The most recent Response object
- $exception : Throwable
The caught Exception object
Return values
ResponseInterfaceregisterHandler()
Register an exception handler for a specified exception class.
public
registerHandler(
$exceptionClass :
string
, $handlerClass :
string
)
: mixed
The exception handler must implement \UserFrosting\Sprinkle\Core\Handler\ExceptionHandlerInterface.
Parameters
- $exceptionClass : string
The fully qualified class name of the exception to handle.
- $handlerClass : string
The fully qualified class name of the assigned handler.