File tree Expand file tree Collapse file tree 3 files changed +42
-2
lines changed
src/Sentry/SentryBundle/EventListener Expand file tree Collapse file tree 3 files changed +42
-2
lines changed Original file line number Diff line number Diff line change @@ -146,14 +146,15 @@ sentry:
146
146
// src/AppBundle/EventSubscriber/MySentryEventListener.php
147
147
namespace AppBundle\E ventSubscriber;
148
148
149
+ use Sentry\S entryBundle\E ventListener\S entryExceptionListenerInterface;
149
150
use Symfony\C omponent\C onsole\E vent\C onsoleExceptionEvent;
150
151
use Symfony\C omponent\E ventDispatcher\E ventDispatcherInterface;
151
152
use Symfony\C omponent\H ttpKernel\E vent\G etResponseEvent;
152
153
use Symfony\C omponent\H ttpKernel\E vent\G etResponseForExceptionEvent;
153
154
use Symfony\C omponent\S ecurity\C ore\A uthentication\T oken\S torage\T okenStorageInterface;
154
155
use Symfony\C omponent\S ecurity\C ore\A uthorization\A uthorizationCheckerInterface;
155
156
156
- class MySentryExceptionListener
157
+ class MySentryExceptionListener implements SentryExceptionListenerInterface
157
158
{
158
159
// ...
159
160
Original file line number Diff line number Diff line change 20
20
* Class ExceptionListener
21
21
* @package Sentry\SentryBundle\EventListener
22
22
*/
23
- class ExceptionListener
23
+ class ExceptionListener implements SentryExceptionListenerInterface
24
24
{
25
25
/** @var TokenStorageInterface */
26
26
private $ tokenStorage ;
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Sentry \SentryBundle \EventListener ;
4
+
5
+ use Symfony \Component \Console \Event \ConsoleExceptionEvent ;
6
+ use Symfony \Component \HttpKernel \Event \GetResponseEvent ;
7
+ use Symfony \Component \HttpKernel \Event \GetResponseForExceptionEvent ;
8
+
9
+ interface SentryExceptionListenerInterface
10
+ {
11
+
12
+ /**
13
+ * Used to capture information from the request before any possible error
14
+ * event is encountered by listening on core.request.
15
+ *
16
+ * Most commonly used for assigning the username to the security context
17
+ * used by Sentry for each request.
18
+ *
19
+ * @param GetResponseEvent $event
20
+ */
21
+ function onKernelRequest (GetResponseEvent $ event );
22
+
23
+ /**
24
+ * When an exception occurs as part of a web request, this method will be
25
+ * triggered for capturing the error.
26
+ *
27
+ * @param GetResponseForExceptionEvent $event
28
+ */
29
+ function onKernelException (GetResponseForExceptionEvent $ event );
30
+
31
+ /**
32
+ * When an exception occurs on the command line, this method will be
33
+ * triggered for capturing the error.
34
+ *
35
+ * @param ConsoleExceptionEvent $event
36
+ */
37
+ function onConsoleException (ConsoleExceptionEvent $ event );
38
+
39
+ }
You can’t perform that action at this time.
0 commit comments