Documentation

ErrorHandler
in package
implements MiddlewareInterface

Wraps uncaught exceptions into a JSON response.

Sets HTTP response code to the exception's code if it is within 400-499.

Tags
since
18.0.41

Interfaces, Classes and Traits

MiddlewareInterface

Table of Contents

__construct()  : mixed
process()  : ResponseInterface

Methods

__construct()

public __construct(ResponseFactoryInterface $factory) : mixed
Parameters
$factory : ResponseFactoryInterface
Return values
mixed

process()

public process(ServerRequestInterface $request, RequestHandlerInterface $handler) : ResponseInterface
Parameters
$request : ServerRequestInterface
$handler : RequestHandlerInterface
Return values
ResponseInterface

Search results