Reporter
Logs exceptions that occur further inside the layer pipeline.
Constructors / Destructors
| Returns | Signature and Description |
|---|---|
void | __construct()Creates a new error Reporter. |
Instance Methods
| Returns | Signature and Description |
|---|---|
ResponseInterface | __invoke(, , )Middleware request–response handling. |
int | Gets the plugin priority; larger means first. |
Method Details
__construct
public function
__construct(ErrorLogger $errorLogger)Creates a new error Reporter.
| Name | Type | Description |
|---|---|---|
$errorLogger | ErrorLogger | The error logger |
__invoke
public function
__invoke(ServerRequestInterface $request, ResponseInterface $response, (function(Request,Response):Response) $next)Middleware request–response handling.
Performs a typical passthru (i.e. return $next($req, $res);), but in
the event an Exception occurs, the $errorLogger is called, then the
Exception is rethrown (most likely to be caught higher in the queue).
| Name | Type | Description |
|---|---|---|
$request | ServerRequestInterface | The server request |
$response | ResponseInterface | The response |
$next | (function(Request,Response):Response) |
| Type | Description |
|---|---|
ResponseInterface | The response |
| Type | Conditions |
|---|---|
Exception | rethrows any exception that occurs after logging. |
getPriority
public function
getPriority()Gets the plugin priority; larger means first.
| Type | Description |
|---|---|
int | The plugin priority |