Skip to content

Commit 4dcdb02

Browse files
authored
Fix missing scope information on unhandled exceptions (#611)
1 parent 22e9c9d commit 4dcdb02

File tree

2 files changed

+3
-11
lines changed

2 files changed

+3
-11
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## Unreleased
44

5+
- Fix missing scope information on unhandled exceptions (#611)
6+
57
## 3.1.0
68

79
- Unhandled exceptions are now correctly marked as `handled: false` and displayed as such on the issues list and detail page (#608)

src/Sentry/Laravel/Integration.php

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -177,20 +177,10 @@ public static function sentryBaggageMeta(): string
177177
*/
178178
public static function captureUnhandledException(Throwable $throwable): ?EventId
179179
{
180-
$client = SentrySdk::getCurrentHub()->getClient();
181-
182-
// When Sentry is not configured, because for example no DSN
183-
// is set the client can be null. If that is the case we cannot
184-
// transmit the event so, exit early to prevent doing useless work
185-
if ($client === null) {
186-
return null;
187-
}
188-
189180
$hint = EventHint::fromArray([
190-
'exception' => $throwable,
191181
'mechanism' => new ExceptionMechanism(ExceptionMechanism::TYPE_GENERIC, false),
192182
]);
193183

194-
return $client->captureEvent(Event::createEvent(), $hint);
184+
return SentrySdk::getCurrentHub()->captureException($throwable, $hint);
195185
}
196186
}

0 commit comments

Comments
 (0)