Skip to content

Commit b795cf8

Browse files
authored
Merge pull request #56 from getsentry/improvements_on_pr_47
Fix small issue and update changelog
2 parents 0d2a008 + 8d785a1 commit b795cf8

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

CHANGES

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
0.8.0
22
-----
3+
- Add `SentryExceptionListenerInterface` and the `exception_listener` option in the configuration (#47) to allow customization of the exception listener
4+
- Add `SentrySymfonyEvents::PRE_CAPTURE` and `SentrySymfonyEvents::SET_USER_CONTEXT` events (#47) to customize event capturing information
5+
- Make SkipCapture work on console exceptions too
36

47
0.7.1
58
-----

src/Sentry/SentryBundle/EventListener/ExceptionListener.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@ public function __construct(
5252
array $skipCapture,
5353
EventDispatcherInterface $dispatcher
5454
) {
55-
if (!$client) {
55+
if (! $client) {
5656
$client = new SentrySymfonyClient();
5757
}
5858

5959
$this->tokenStorage = $tokenStorage;
6060
$this->authorizationChecker = $authorizationChecker;
61-
$this->dispatcher = $dispatcher;
61+
$this->eventDispatcher = $dispatcher;
6262
$this->client = $client;
6363
$this->skipCapture = $skipCapture;
6464
}
@@ -92,7 +92,7 @@ public function onKernelRequest(GetResponseEvent $event)
9292
$this->setUserValue($token->getUser());
9393

9494
$contextEvent = new SentryUserContextEvent($token);
95-
$this->dispatcher->dispatch(SentrySymfonyEvents::SET_USER_CONTEXT, $contextEvent);
95+
$this->eventDispatcher->dispatch(SentrySymfonyEvents::SET_USER_CONTEXT, $contextEvent);
9696
}
9797
}
9898

@@ -107,7 +107,7 @@ public function onKernelException(GetResponseForExceptionEvent $event)
107107
return;
108108
}
109109

110-
$this->dispatcher->dispatch(SentrySymfonyEvents::PRE_CAPTURE, $event);
110+
$this->eventDispatcher->dispatch(SentrySymfonyEvents::PRE_CAPTURE, $event);
111111
$this->client->captureException($exception);
112112
}
113113

@@ -130,7 +130,7 @@ public function onConsoleException(ConsoleExceptionEvent $event)
130130
),
131131
);
132132

133-
$this->dispatcher->dispatch(SentrySymfonyEvents::PRE_CAPTURE, $event);
133+
$this->eventDispatcher->dispatch(SentrySymfonyEvents::PRE_CAPTURE, $event);
134134
$this->client->captureException($exception, $data);
135135
}
136136

@@ -153,11 +153,13 @@ private function setUserValue($user)
153153
{
154154
if ($user instanceof UserInterface) {
155155
$this->client->set_user_data($user->getUsername());
156+
156157
return;
157158
}
158159

159160
if (is_string($user)) {
160161
$this->client->set_user_data($user);
162+
161163
return;
162164
}
163165

0 commit comments

Comments
 (0)