diff --git a/src/EventListener/ErrorListener.php b/src/EventListener/ErrorListener.php index 862cfe7a..14f1eb91 100644 --- a/src/EventListener/ErrorListener.php +++ b/src/EventListener/ErrorListener.php @@ -2,12 +2,25 @@ namespace Sentry\SentryBundle\EventListener; +use Sentry\State\HubInterface; use Symfony\Component\Console\Event\ConsoleErrorEvent; use Symfony\Component\Console\Event\ConsoleExceptionEvent; use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent; final class ErrorListener { + /** @var HubInterface */ + private $hub; + + /** + * ErrorListener constructor. + * @param HubInterface $hub + */ + public function __construct(HubInterface $hub) + { + $this->hub = $hub; // not used, needed to trigger instantiation + } + public function onKernelException(GetResponseForExceptionEvent $event): void { \Sentry\captureException($event->getException()); diff --git a/src/Resources/config/services.xml b/src/Resources/config/services.xml index e45c32ed..df467a04 100644 --- a/src/Resources/config/services.xml +++ b/src/Resources/config/services.xml @@ -31,6 +31,7 @@ +