File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -30,8 +30,8 @@ public function execute(Observer $observer): void
30
30
$ event = $ observer ->getEvent ()->getSentryEvent ()->getEvent ();
31
31
$ hint = $ observer ->getEvent ()->getSentryEvent ()->getHint ();
32
32
33
- $ hintMessage = $ hint ->exception ->getMessage ();
34
- if ($ hint ->exception instanceof LocalizedException) {
33
+ $ hintMessage = $ hint? ->exception?->getMessage() ?? $ event ->getMessage ();
34
+ if ($ hint? ->exception instanceof LocalizedException) {
35
35
$ hintMessage = $ hint ->exception ->getRawMessage ();
36
36
$ event ->setMessage ($ hintMessage );
37
37
}
@@ -40,7 +40,9 @@ public function execute(Observer $observer): void
40
40
foreach ($ messages as $ message ) {
41
41
if (str_contains ($ hintMessage , $ message ['message ' ])) {
42
42
$ observer ->getEvent ()->getSentryEvent ()->unsEvent ();
43
+ break ;
43
44
}
44
45
}
46
+
45
47
}
46
48
}
You can’t perform that action at this time.
0 commit comments