From 3721af5459d032df79358f3942ca6e66944bc553 Mon Sep 17 00:00:00 2001 From: David Cramer Date: Thu, 8 Dec 2016 18:22:28 -0800 Subject: [PATCH] Gracefully handle errors capturing breadcrumbs Refs GH-40 --- src/Sentry/SentryLaravel/SentryLaravelEventHandler.php | 10 +++++++++- .../SentryLaravel/SentryLaravelServiceProvider.php | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Sentry/SentryLaravel/SentryLaravelEventHandler.php b/src/Sentry/SentryLaravel/SentryLaravelEventHandler.php index 01a08e2e..e1b015d5 100644 --- a/src/Sentry/SentryLaravel/SentryLaravelEventHandler.php +++ b/src/Sentry/SentryLaravel/SentryLaravelEventHandler.php @@ -26,8 +26,16 @@ public function subscribe(Dispatcher $events) public function onWildcardEvent() { - $name = $this->events->firing(); $args = func_get_args(); + try { + $this->_onWildcardEvent($args); + } catch (\Exception $e) { + } + } + + protected function _onWildcardEvent($args) + { + $name = $this->events->firing(); $data = null; $level = 'info'; if ($name === 'Illuminate\Routing\Events\RouteMatched') { diff --git a/src/Sentry/SentryLaravel/SentryLaravelServiceProvider.php b/src/Sentry/SentryLaravel/SentryLaravelServiceProvider.php index 08f60e32..88a589c3 100644 --- a/src/Sentry/SentryLaravel/SentryLaravelServiceProvider.php +++ b/src/Sentry/SentryLaravel/SentryLaravelServiceProvider.php @@ -89,6 +89,7 @@ public function register() )); } } catch (\Exception $e) { + error_log(sprintf('sentry.breadcrumbs error=%s', $e->getMessage())); } return $client;