forked from cachethq/cachet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
exceptions.php
116 lines (103 loc) · 4.4 KB
/
exceptions.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<?php
/*
* This file is part of Cachet.
*
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
/*
|--------------------------------------------------------------------------
| Exception Transformers
|--------------------------------------------------------------------------
|
| Here are each of the exception transformers setup for your application.
|
| This allows you to turn your exceptions into other exceptions such as
| http exceptions for perfect results when passed to the displayers. Note
| that this list is processed in order and subsequent transformers can
| still modify the results of previous ones if required.
|
*/
'transformers' => [
'GrahamCampbell\Exceptions\Transformers\AuthTransformer',
'GrahamCampbell\Exceptions\Transformers\CsrfTransformer',
'GrahamCampbell\Exceptions\Transformers\ModelTransformer',
'CachetHQ\Cachet\Exceptions\Transformers\BusTransformer',
],
/*
|--------------------------------------------------------------------------
| Exception Displayers
|--------------------------------------------------------------------------
|
| Here are each of the exception displayers setup for your application.
|
| These displayers are sorted by priority. Note that when we are in debug
| mode, we will select the first valid displayer from the list, and when we
| are not in debug mode, we'll filter out all verbose displayers, then
| select the first valid displayer from the new list.
|
*/
'displayers' => [
'CachetHQ\Cachet\Exceptions\Displayers\MaintenanceDisplayer',
'CachetHQ\Cachet\Exceptions\Displayers\SettingsDisplayer',
'CachetHQ\Cachet\Exceptions\Displayers\RedirectDisplayer',
'CachetHQ\Cachet\Exceptions\Displayers\ThrottleDisplayer',
'CachetHQ\Cachet\Exceptions\Displayers\JsonValidationDisplayer',
'GrahamCampbell\Exceptions\Displayers\DebugDisplayer',
'GrahamCampbell\Exceptions\Displayers\HtmlDisplayer',
'GrahamCampbell\Exceptions\Displayers\JsonDisplayer',
'GrahamCampbell\Exceptions\Displayers\JsonApiDisplayer',
],
/*
|--------------------------------------------------------------------------
| Displayer Filters
|--------------------------------------------------------------------------
|
| Here are each of the filters for the displayers.
|
| This allows you to apply filters to your displayers in order to work out
| which displayer to use for each exception. This includes things like
| content type negotiation.
|
*/
'filters' => [
'GrahamCampbell\Exceptions\Filters\VerboseFilter',
'GrahamCampbell\Exceptions\Filters\CanDisplayFilter',
'GrahamCampbell\Exceptions\Filters\ContentTypeFilter',
'CachetHQ\Cachet\Exceptions\Filters\ApiFilter',
],
/*
|--------------------------------------------------------------------------
| Default Displayer
|--------------------------------------------------------------------------
|
| Here you may define the default displayer for your application.
|
| This displayer will be used if your filters have filtered out all the
| displayers, otherwise leaving us unable to displayer the exception.
|
*/
'default' => 'GrahamCampbell\Exceptions\Displayers\HtmlDisplayer',
/*
|--------------------------------------------------------------------------
| Exception Levels
|--------------------------------------------------------------------------
|
| Here are each of the log levels for the each exception.
|
| If an exception passes an instance of test for each key, then the log
| level used is the value associated with each key.
|
*/
'levels' => [
'Illuminate\Auth\Access\AuthorizationException' => 'warning',
'Illuminate\Database\Eloquent\ModelNotFoundException' => 'warning',
'Illuminate\Session\TokenMismatchException' => 'notice',
'Symfony\Component\HttpKernel\Exception\HttpExceptionInterface' => 'notice',
'Symfony\Component\Debug\Exception\FatalErrorException' => 'critical',
'Exception' => 'error',
],
];