Total Complexity | 6 |
Total Lines | 65 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
7 | class Handler extends ExceptionHandler |
||
8 | { |
||
9 | /** |
||
10 | * A list of the exception types that are not reported. |
||
11 | * |
||
12 | * @var array |
||
13 | */ |
||
14 | protected $dontReport = [ |
||
15 | // |
||
16 | ]; |
||
17 | |||
18 | /** |
||
19 | * A list of the inputs that are never flashed for validation exceptions. |
||
20 | * |
||
21 | * @var array |
||
22 | */ |
||
23 | protected $dontFlash = [ |
||
24 | 'password', |
||
25 | 'password_confirmation', |
||
26 | ]; |
||
27 | |||
28 | /** |
||
29 | * Catch errors with Sentry. |
||
30 | */ |
||
31 | public function register(): void |
||
32 | { |
||
33 | $this->reportable(function (Throwable $e) { |
||
|
|||
34 | if (app()->bound('sentry')) { |
||
35 | app('sentry')->captureException($e); |
||
36 | } |
||
37 | }); |
||
38 | } |
||
39 | |||
40 | /** |
||
41 | * Report or log an exception. |
||
42 | * |
||
43 | * |
||
44 | * @return void |
||
45 | * |
||
46 | * @throws \Throwable |
||
47 | */ |
||
48 | public function report(\Throwable $exception) |
||
49 | { |
||
50 | parent::report($exception); |
||
51 | } |
||
52 | |||
53 | /** |
||
54 | * @param \Illuminate\Http\Request $request |
||
55 | * @return \Illuminate\Http\RedirectResponse|\Symfony\Component\HttpFoundation\Response |
||
56 | * |
||
57 | * @throws \Throwable |
||
58 | */ |
||
59 | public function render($request, \Throwable $exception) |
||
72 | } |
||
73 | } |
||
74 |