File tree Expand file tree Collapse file tree 1 file changed +19
-4
lines changed
src/Sentry/SentryBundle/EventListener Expand file tree Collapse file tree 1 file changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -90,10 +90,9 @@ public function onKernelRequest(GetResponseEvent $event)
90
90
public function onKernelException (GetResponseForExceptionEvent $ event )
91
91
{
92
92
$ exception = $ event ->getException ();
93
- foreach ($ this ->skipCapture as $ className ) {
94
- if ($ exception instanceof $ className ) {
95
- return ;
96
- }
93
+
94
+ if ($ this ->shouldExceptionCaptureBeSkipped ($ exception )) {
95
+ return ;
97
96
}
98
97
99
98
$ this ->client ->captureException ($ exception );
@@ -106,6 +105,10 @@ public function onConsoleException(ConsoleExceptionEvent $event)
106
105
{
107
106
$ command = $ event ->getCommand ();
108
107
$ exception = $ event ->getException ();
108
+
109
+ if ($ this ->shouldExceptionCaptureBeSkipped ($ exception )) {
110
+ return ;
111
+ }
109
112
110
113
$ data = array (
111
114
'tags ' => array (
@@ -116,6 +119,18 @@ public function onConsoleException(ConsoleExceptionEvent $event)
116
119
117
120
$ this ->client ->captureException ($ exception , $ data );
118
121
}
122
+
123
+ private function shouldExceptionCaptureBeSkipped (\Exception $ exception )
124
+ {
125
+ foreach ($ this ->skipCapture as $ className ) {
126
+ if ($ exception instanceof $ className ) {
127
+ return true ;
128
+ }
129
+ }
130
+
131
+ return false ;
132
+ }
133
+
119
134
120
135
/**
121
136
* @param UserInterface | object | string $user
You can’t perform that action at this time.
0 commit comments