Moodle PHP Documentation 5.1
Moodle 5.1dev (Build: 20250620) (7d9030acd6e)
|
Public Member Functions | |
__construct (CallableResolverInterface $callableResolver, ResponseFactoryInterface $responseFactory, bool $displayErrorDetails, bool $logErrors, bool $logErrorDetails, ?LoggerInterface $logger=null) | |
getDefaultErrorHandler () | |
Get default error handler. | |
getErrorHandler (string $type) | |
Get callable to handle scenarios where an error occurs when processing the current request. | |
handleException (ServerRequestInterface $request, Throwable $exception) | |
process (ServerRequestInterface $request, RequestHandlerInterface $handler) | |
Process an incoming server request. | |
setDefaultErrorHandler ($handler) | |
Set callable as the default Slim application error handler. | |
setErrorHandler ($typeOrTypes, $handler, bool $handleSubclasses=false) | |
Set callable to handle scenarios where an error occurs when processing the current request. | |
Protected Attributes | |
CallableResolverInterface | $callableResolver |
ErrorHandlerInterface callable string null | $defaultErrorHandler |
bool | $displayErrorDetails |
ErrorHandlerInterface[] callable[] string[] array | $handlers = [] |
bool | $logErrorDetails |
bool | $logErrors |
LoggerInterface | $logger = null |
ResponseFactoryInterface | $responseFactory |
ErrorHandlerInterface[] callable[] string[] array | $subClassHandlers = [] |
Slim\Middleware\ErrorMiddleware::getDefaultErrorHandler | ( | ) |
Get default error handler.
ErrorHandler|callable |
Slim\Middleware\ErrorMiddleware::getErrorHandler | ( | string | $type | ) |
Get callable to handle scenarios where an error occurs when processing the current request.
string | $type | Exception/Throwable name. ie: RuntimeException::class |
callable|ErrorHandler |
Slim\Middleware\ErrorMiddleware::process | ( | ServerRequestInterface | $request, |
RequestHandlerInterface | $handler ) |
Process an incoming server request.
Processes an incoming server request in order to produce a response. If unable to produce the response itself, it may delegate to the provided request handler to do so.
Implements Psr\Http\Server\MiddlewareInterface.
Slim\Middleware\ErrorMiddleware::setDefaultErrorHandler | ( | $handler | ) |
Set callable as the default Slim application error handler.
The callable signature MUST match the ErrorHandlerInterface
The callable MUST return an instance of Psr\Http\Message\ResponseInterface.
string | callable | ErrorHandler | $handler |
Slim\Middleware\ErrorMiddleware::setErrorHandler | ( | $typeOrTypes, | |
$handler, | |||
bool | $handleSubclasses = false ) |
Set callable to handle scenarios where an error occurs when processing the current request.
The callable signature MUST match the ErrorHandlerInterface
Pass true to $handleSubclasses to make the handler handle all subclasses of the type as well. Pass an array of classes to make the same function handle multiple exceptions.
The callable MUST return an instance of Psr\Http\Message\ResponseInterface.
string | string[] | $typeOrTypes | Exception/Throwable name. ie: RuntimeException::class or an array of classes ie: [HttpNotFoundException::class, HttpMethodNotAllowedException::class] |
string | callable | ErrorHandlerInterface | $handler |