1
|
|
|
<?php |
2
|
|
|
declare(strict_types=1); |
3
|
|
|
|
4
|
|
|
|
5
|
|
|
/** |
6
|
|
|
* Handler.php |
7
|
|
|
* Copyright (c) 2020 [email protected] |
8
|
|
|
* |
9
|
|
|
* This file is part of the Firefly III CSV importer |
10
|
|
|
* (https://github.com/firefly-iii/csv-importer). |
11
|
|
|
* |
12
|
|
|
* This program is free software: you can redistribute it and/or modify |
13
|
|
|
* it under the terms of the GNU Affero General Public License as |
14
|
|
|
* published by the Free Software Foundation, either version 3 of the |
15
|
|
|
* License, or (at your option) any later version. |
16
|
|
|
* |
17
|
|
|
* This program is distributed in the hope that it will be useful, |
18
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
19
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
20
|
|
|
* GNU Affero General Public License for more details. |
21
|
|
|
* |
22
|
|
|
* You should have received a copy of the GNU Affero General Public License |
23
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>. |
24
|
|
|
*/ |
25
|
|
|
|
26
|
|
|
namespace App\Exceptions; |
27
|
|
|
|
28
|
|
|
use Exception; |
29
|
|
|
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; |
30
|
|
|
use Illuminate\Http\Request; |
31
|
|
|
use Symfony\Component\HttpFoundation\Response; |
32
|
|
|
use Throwable; |
33
|
|
|
|
34
|
|
|
/** |
35
|
|
|
* Class Handler |
36
|
|
|
*/ |
37
|
|
|
class Handler extends ExceptionHandler |
38
|
|
|
{ |
39
|
|
|
/** |
40
|
|
|
* A list of the exception types that are not reported. |
41
|
|
|
* |
42
|
|
|
* @var array |
43
|
|
|
*/ |
44
|
|
|
protected $dontReport = [ |
45
|
|
|
// |
46
|
|
|
]; |
47
|
|
|
|
48
|
|
|
/** |
49
|
|
|
* A list of the inputs that are never flashed for validation exceptions. |
50
|
|
|
* |
51
|
|
|
* @var array |
52
|
|
|
*/ |
53
|
|
|
protected $dontFlash = [ |
54
|
|
|
'password', |
55
|
|
|
'password_confirmation', |
56
|
|
|
]; |
57
|
|
|
|
58
|
|
|
/** |
59
|
|
|
* Report or log an exception. |
60
|
|
|
* |
61
|
|
|
* @param Throwable $exception |
62
|
|
|
* |
63
|
|
|
* @throws Exception |
64
|
|
|
*@return void |
65
|
|
|
* |
66
|
|
|
*/ |
67
|
|
|
public function report(Throwable $exception): void |
68
|
|
|
{ |
69
|
|
|
parent::report($exception); |
70
|
|
|
} |
71
|
|
|
|
72
|
|
|
/** |
73
|
|
|
* Render an exception into an HTTP response. |
74
|
|
|
* |
75
|
|
|
* @param Request $request |
76
|
|
|
* @param Throwable $exception |
77
|
|
|
* |
78
|
|
|
* @throws Throwable |
79
|
|
|
*@return Response |
80
|
|
|
* |
81
|
|
|
*/ |
82
|
|
|
public function render($request, Throwable $exception) |
83
|
|
|
{ |
84
|
|
|
return parent::render($request, $exception); |
85
|
|
|
} |
86
|
|
|
} |
87
|
|
|
|