class HandleErrors implements MiddlewareInterface

Catch exceptions thrown in a PSR-15 middleware stack and handle them safely.

All errors will be rendered using the provided formatter. In addition, unknown errors will be passed on to one or multiple {see \Flarum\Foundation\ErrorHandling\Reporter} instances.

Properties

protected Registry $registry
protected HttpFormatter $formatter
protected Reporter[] $reporters

Methods

__construct(Registry $registry, HttpFormatter $formatter, iterable $reporters)

No description

ResponseInterface
process(ServerRequestInterface $request, RequestHandlerInterface $handler)

Catch all errors that happen during further middleware execution.

Details

__construct(Registry $registry, HttpFormatter $formatter, iterable $reporters)

Parameters

Registry $registry
HttpFormatter $formatter
iterable $reporters

ResponseInterface process(ServerRequestInterface $request, RequestHandlerInterface $handler)

Catch all errors that happen during further middleware execution.

Parameters

ServerRequestInterface $request
RequestHandlerInterface $handler

Return Value

ResponseInterface