From 3c5ccf2da3f03fb2e701c852e4286c597226739a Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 10 Apr 2019 12:01:28 +1000 Subject: [PATCH] Add Sentry Support --- app/Exceptions/Handler.php | 9 ++++++--- composer.json | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index 7000f4b7c4c8..4ae65d51d82b 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -36,10 +36,11 @@ class Handler extends ExceptionHandler */ public function report(Exception $exception) { + if (app()->bound('sentry') && $this->shouldReport($exception)) { + app('sentry')->captureException($exception); + } + parent::report($exception); - - - } /** @@ -62,6 +63,8 @@ class Handler extends ExceptionHandler } + + protected function unauthenticated($request, AuthenticationException $exception) { if ($request->expectsJson()) { diff --git a/composer.json b/composer.json index f1dc9f801a62..ef712e352818 100644 --- a/composer.json +++ b/composer.json @@ -30,6 +30,7 @@ "league/fractal": "^0.17.0", "nwidart/laravel-modules": "^4.0", "predis/predis": "^1.1", + "sentry/sentry-laravel": "^1.0", "webpatser/laravel-countries": "dev-master#75992ad", "wildbit/postmark-php": "^2.6" },