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 {\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)

<p>Catch all errors that happen during further middleware execution.</p>

Details

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

Parameters

Registry $registry
HttpFormatter $formatter
iterable $reporters

ResponseInterface process(ServerRequestInterface $request, RequestHandlerInterface $handler)

<p>Catch all errors that happen during further middleware execution.</p>

Parameters

ServerRequestInterface $request
RequestHandlerInterface $handler

Return Value

ResponseInterface