diff --git a/CHANGES b/CHANGES index 1758b1c7..40455258 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ 0.8.0 ----- + - Add `SentryExceptionListenerInterface` and the `exception_listener` option in the configuration (#47) to allow customization of the exception listener + - Add `SentrySymfonyEvents::PRE_CAPTURE` and `SentrySymfonyEvents::SET_USER_CONTEXT` events (#47) to customize event capturing information + - Make SkipCapture work on console exceptions too 0.7.1 ----- diff --git a/src/Sentry/SentryBundle/EventListener/ExceptionListener.php b/src/Sentry/SentryBundle/EventListener/ExceptionListener.php index 5533b187..f3a7e452 100644 --- a/src/Sentry/SentryBundle/EventListener/ExceptionListener.php +++ b/src/Sentry/SentryBundle/EventListener/ExceptionListener.php @@ -52,13 +52,13 @@ public function __construct( array $skipCapture, EventDispatcherInterface $dispatcher ) { - if (!$client) { + if (! $client) { $client = new SentrySymfonyClient(); } $this->tokenStorage = $tokenStorage; $this->authorizationChecker = $authorizationChecker; - $this->dispatcher = $dispatcher; + $this->eventDispatcher = $dispatcher; $this->client = $client; $this->skipCapture = $skipCapture; } @@ -92,7 +92,7 @@ public function onKernelRequest(GetResponseEvent $event) $this->setUserValue($token->getUser()); $contextEvent = new SentryUserContextEvent($token); - $this->dispatcher->dispatch(SentrySymfonyEvents::SET_USER_CONTEXT, $contextEvent); + $this->eventDispatcher->dispatch(SentrySymfonyEvents::SET_USER_CONTEXT, $contextEvent); } } @@ -107,7 +107,7 @@ public function onKernelException(GetResponseForExceptionEvent $event) return; } - $this->dispatcher->dispatch(SentrySymfonyEvents::PRE_CAPTURE, $event); + $this->eventDispatcher->dispatch(SentrySymfonyEvents::PRE_CAPTURE, $event); $this->client->captureException($exception); } @@ -130,7 +130,7 @@ public function onConsoleException(ConsoleExceptionEvent $event) ), ); - $this->dispatcher->dispatch(SentrySymfonyEvents::PRE_CAPTURE, $event); + $this->eventDispatcher->dispatch(SentrySymfonyEvents::PRE_CAPTURE, $event); $this->client->captureException($exception, $data); } @@ -153,11 +153,13 @@ private function setUserValue($user) { if ($user instanceof UserInterface) { $this->client->set_user_data($user->getUsername()); + return; } if (is_string($user)) { $this->client->set_user_data($user); + return; }