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