Final Class Yiisoft\Yii\Sentry\SentryMiddleware
| Inheritance | Yiisoft\ |
|---|---|
| Implements | Psr\ |
Catches web application exceptions and forwards them to Sentry.
In order to catch all exceptions, add it right after ErrorCatcher in the main middleware set.
Public Methods
| Method | Description | Defined By |
|---|---|---|
| __construct() | Yiisoft\ |
|
| process() | Yiisoft\ |
Method Details
| public mixed __construct ( \ | ||
| $hub | \ |
|
public function __construct(private readonly HubInterface $hub) {}
| public \ | ||
| $request | \ |
|
| $handler | \ |
|
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
{
try {
return $handler->handle($request);
} catch (Throwable $e) {
$this->hub->captureException($e);
throw $e;
}
}
User Contributed Notes
Leave a comment
Join the conversation to share a note.