Skip to content

Commit

Permalink
Fix the bug for sentry (#149)
Browse files Browse the repository at this point in the history
Co-authored-by: Deeka Wong <[email protected]>
  • Loading branch information
huangdijia and huangdijia authored Mar 2, 2023
1 parent 8a0cfec commit 9b222ca
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/sentry/src/SentryExceptionHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,12 @@ class SentryExceptionHandler extends ExceptionHandler
{
protected ConfigInterface $config;

protected StdoutLoggerInterface $logger;

public function __construct(protected ContainerInterface $container)
{
$this->config = $container->get(ConfigInterface::class);
$this->logger = $container->get(StdoutLoggerInterface::class);
}

/**
Expand All @@ -38,9 +41,9 @@ public function handle(Throwable $throwable, ResponseInterface $response): Respo

$hub->captureException($throwable);

$hub->getClient()->flush();
$hub->getClient()?->flush();
} catch (Throwable $e) {
$this->container->get(StdoutLoggerInterface::class)->error((string) $e);
$this->logger->error((string) $e);
}
});

Expand Down

0 comments on commit 9b222ca

Please sign in to comment.