File tree Expand file tree Collapse file tree 3 files changed +316
-5
lines changed
Expand file tree Collapse file tree 3 files changed +316
-5
lines changed Original file line number Diff line number Diff line change 33namespace HiEvents \Exceptions ;
44
55use Illuminate \Foundation \Exceptions \Handler as ExceptionHandler ;
6+ use Sentry \Laravel \Facade as Sentry ;
67use Symfony \Component \Routing \Exception \ResourceNotFoundException ;
78use Throwable ;
89
@@ -14,7 +15,7 @@ class Handler extends ExceptionHandler
1415 * @var array
1516 */
1617 protected $ dontReport = [
17- //
18+ // Add exceptions that shouldn't be reported
1819 ];
1920
2021 /**
@@ -30,20 +31,25 @@ class Handler extends ExceptionHandler
3031 /**
3132 * Report or log an exception.
3233 *
33- * @param \Exception $e
34+ * @param Throwable $e
3435 * @return void
36+ * @throws Throwable
3537 */
3638 public function report (Throwable $ e )
3739 {
40+ if ($ this ->shouldReport ($ e )) {
41+ Sentry::captureException ($ e );
42+ }
43+
3844 parent ::report ($ e );
3945 }
4046
4147 /**
4248 * Render an exception into an HTTP response.
4349 *
4450 * @param \Illuminate\Http\Request $request
45- * @param \Exception $exception
46- * @return \Illuminate\Http\JsonResponse
51+ * @param Throwable $exception
52+ * @return \Illuminate\Http\JsonResponse|\Illuminate\Http\Response
4753 * @throws Throwable
4854 */
4955 public function render ($ request , Throwable $ exception )
Original file line number Diff line number Diff line change 2222 "maatwebsite/excel" : " ^3.1" ,
2323 "nette/php-generator" : " ^4.0" ,
2424 "php-open-source-saver/jwt-auth" : " ^2.1" ,
25+ "sentry/sentry-laravel" : " ^4.13" ,
2526 "spatie/icalendar-generator" : " ^2.8" ,
2627 "spatie/laravel-data" : " ^4.11" ,
2728 "spatie/laravel-webhook-server" : " ^3.8" ,
You can’t perform that action at this time.
0 commit comments