You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- in `config/config.php` add `\Dot\ErrorHandler\ConfigProvider`
26
40
- in `config/pipeline.php` add `\Dot\ErrorHandler\ErrorHandlerInterface::class`
27
41
- the interface is used as an alias to keep all error handling related configurations in one file
28
-
-**IMPORTANT NOTE** there should be no other error handlers after this one (only before) because the other error handler will catch the error causing dot-errorhandler not to catch any error, we recommend using just one error handler unless you have an error-specific handler
29
42
30
-
- Configure the error handler as shown below
43
+
> If you need other error handlers, you should place them before DotErrorhandler in the pipeline; else it will not be able to catch errors.
44
+
> We recommend using just one error handler unless you have an error-specific handler.
31
45
32
-
config/autoload/error-handling.global.php
46
+
- Configure the error handler as shown below.
47
+
48
+
In `config/autoload/error-handling.global.php`:
33
49
34
50
```php
35
51
<?php
@@ -54,45 +70,35 @@ return [
54
70
55
71
A configuration example for the default logger can be found in `config/log.global.php.dist`.
56
72
57
-
When declaring the `ErrorHandlerInterface` alias you can choose whether to log or not:
58
-
59
-
- for logging use `LogErrorHandler`
60
-
- for the simple Zend Expressive handler user `ErrorHandler`
73
+
When configuring the error handler in your application, you can choose between two classes:
61
74
62
-
The class `Dot\ErrorHandler\ErrorHandler` is the same as the Zend Expressive error handling class
63
-
the only difference being the removal of the `final` statement for making extension possible.
75
+
-`Dot\ErrorHandler\LogErrorHandler`: for logging and displaying errors
76
+
-`Dot\ErrorHandler\ErrorHandler`: for displaying errors only
64
77
65
-
The class `Dot\ErrorHandler\LogErrorHandler` is `Dot\ErrorHandler\ErrorHandler` with
66
-
added logging support.
67
-
68
-
As a note: both `LogErrorHandler` and `ErrorHandler` have factories declared in the
69
-
package's `ConfigProvider`. If you need a custom ErrorHandler it must have a factory
70
-
declared in the config, as in the example.
78
+
> Both `LogErrorHandler` and `ErrorHandler` have factories declared in the package's `ConfigProvider`.
79
+
> If you need a custom ErrorHandler, it must have a factory declared in the config, as in the below example:
0 commit comments