Skip to content

Commit 3721af5

Browse files
committed
Gracefully handle errors capturing breadcrumbs
Refs GH-40
1 parent e59fa72 commit 3721af5

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/Sentry/SentryLaravel/SentryLaravelEventHandler.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,16 @@ public function subscribe(Dispatcher $events)
2626

2727
public function onWildcardEvent()
2828
{
29-
$name = $this->events->firing();
3029
$args = func_get_args();
30+
try {
31+
$this->_onWildcardEvent($args);
32+
} catch (\Exception $e) {
33+
}
34+
}
35+
36+
protected function _onWildcardEvent($args)
37+
{
38+
$name = $this->events->firing();
3139
$data = null;
3240
$level = 'info';
3341
if ($name === 'Illuminate\Routing\Events\RouteMatched') {

src/Sentry/SentryLaravel/SentryLaravelServiceProvider.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ public function register()
8989
));
9090
}
9191
} catch (\Exception $e) {
92+
error_log(sprintf('sentry.breadcrumbs error=%s', $e->getMessage()));
9293
}
9394

9495
return $client;

0 commit comments

Comments
 (0)