Skip to content

Commit d68ae2d

Browse files
authored
Merge pull request #41 from getsentry/feature/handle-breadcrumb-errors
Gracefully handle errors capturing breadcrumbs
2 parents be96cb9 + 3721af5 commit d68ae2d

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
@@ -95,6 +95,7 @@ public function register()
9595
));
9696
}
9797
} catch (\Exception $e) {
98+
error_log(sprintf('sentry.breadcrumbs error=%s', $e->getMessage()));
9899
}
99100

100101
return $client;

0 commit comments

Comments
 (0)