Add Sentry Support

This commit is contained in:
David Bomba 2019-04-10 12:01:28 +10:00
parent 35c196305e
commit 3c5ccf2da3
2 changed files with 7 additions and 3 deletions

View File

@ -36,10 +36,11 @@ class Handler extends ExceptionHandler
*/ */
public function report(Exception $exception) public function report(Exception $exception)
{ {
if (app()->bound('sentry') && $this->shouldReport($exception)) {
app('sentry')->captureException($exception);
}
parent::report($exception); parent::report($exception);
} }
/** /**
@ -62,6 +63,8 @@ class Handler extends ExceptionHandler
} }
protected function unauthenticated($request, AuthenticationException $exception) protected function unauthenticated($request, AuthenticationException $exception)
{ {
if ($request->expectsJson()) { if ($request->expectsJson()) {

View File

@ -30,6 +30,7 @@
"league/fractal": "^0.17.0", "league/fractal": "^0.17.0",
"nwidart/laravel-modules": "^4.0", "nwidart/laravel-modules": "^4.0",
"predis/predis": "^1.1", "predis/predis": "^1.1",
"sentry/sentry-laravel": "^1.0",
"webpatser/laravel-countries": "dev-master#75992ad", "webpatser/laravel-countries": "dev-master#75992ad",
"wildbit/postmark-php": "^2.6" "wildbit/postmark-php": "^2.6"
}, },