-
Notifications
You must be signed in to change notification settings - Fork 0
/
laravception.php
78 lines (72 loc) · 3.26 KB
/
laravception.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
<?php
/**
* @author enea dhack <enea.so@live.com>
*/
declare(strict_types=1);
use Vaened\Laravception\Exceptions\TranslatableException;
return [
/*
|--------------------------------------------------------------------------
| Exception Decoding Mode
|--------------------------------------------------------------------------
|
| Specify the default mode that will be used to decode exceptions. This
| value should correspond to a decoder defined in the 'decoders' array.
| The default mode is 'snake_case', which converts exception class names
| to a readable snake_case format. This mode is only used if the exception
| does not implement the Codeable interface. If the Codeable interface is
| implemented, the exception codes will be taken from that implementation.
|
*/
'decode' => 'snake_case',
/*
|--------------------------------------------------------------------------
| Exception Decoders
|--------------------------------------------------------------------------
|
| This array lists the available decoders for transforming exception class
| names into different formats. Each decoder is represented by a class that
| implements the decoding logic. These decoders are used only if the
| exception does not implement the Codeable interface.
|
*/
'decoders' => [
// The 'snake_case' decoder converts exception class names to snake_case format.
'snake_case' => Vaened\Laravception\Decoders\SnakeCaseExceptionNameParser::class,
],
/*
|--------------------------------------------------------------------------
| Exception Translations
|--------------------------------------------------------------------------
|
| Specify the translation repositories for exceptions. Each key in this
| array corresponds to an exception class, and the value is the name of the
| translation file where the translations for that exception will be found.
| The order in this array matters: more specific exceptions should be
| listed before more general ones (like Throwable) to ensure that
| specific translations are applied first.
|
*/
'translations' => [
// Translations for exceptions implementing TranslatableException will be
// found in the 'exceptions' translation file.
TranslatableException::class => 'exceptions',
],
/*
|--------------------------------------------------------------------------
| Exception Handlers
|--------------------------------------------------------------------------
|
| This array lists the exception handlers that the library will use. Each handler
| is represented by a class that implements the logic for handling specific types
| of exceptions. The order in this array matters: more specific handlers should
| be listed before more general ones to ensure that specific handling is applied
| first. For example, if a handler targets Throwable and is listed first, it will
| catch all exceptions and prevent more specific handlers from being invoked.
|
*/
'handlers' => [
Vaened\Laravception\Handlers\ValidationExceptionHandler::class,
Vaened\Laravception\Handlers\ThrowableHandler::class,
],
];