From 643e5288fd6ed2119a10b5af35c99449e36999e5 Mon Sep 17 00:00:00 2001 From: Alessandro Lai Date: Wed, 17 May 2017 09:27:46 +0200 Subject: [PATCH 1/3] Fix property naming in the ExceptionListener --- .../SentryBundle/EventListener/ExceptionListener.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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; } From 453b446a7f9df186b98e49bcf5d97f678e20bc20 Mon Sep 17 00:00:00 2001 From: Alessandro Lai Date: Wed, 17 May 2017 09:28:20 +0200 Subject: [PATCH 2/3] Add info about #47 in the changelog --- CHANGES | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES b/CHANGES index 1758b1c7..c335e1d3 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,7 @@ 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 0.7.1 ----- From 8d785a1e9f2308d5ee1c9827e1f3064256618ad6 Mon Sep 17 00:00:00 2001 From: Alessandro Lai Date: Wed, 17 May 2017 09:33:45 +0200 Subject: [PATCH 3/3] Add info about SkipCapture on console (#42) on the changelog --- CHANGES | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES b/CHANGES index c335e1d3..40455258 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,7 @@ ----- - 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 -----