3
3
namespace Tools \Error \Middleware ;
4
4
5
5
use Cake \Core \Configure ;
6
- use Cake \Log \Log ;
7
- use Exception ;
8
6
use Cake \Error \Middleware \ErrorHandlerMiddleware as CoreErrorHandlerMiddleware ;
7
+ use Cake \Log \Log ;
9
8
10
9
/**
11
10
* Error handling middleware.
29
28
* In case you need custom 404 mappings for some additional custom exceptions, make use of `log404` option.
30
29
* It will overwrite the current defaults completely.
31
30
*/
32
- class ErrorHandlerMiddleware extends CoreErrorHandlerMiddleware
33
- {
31
+ class ErrorHandlerMiddleware extends CoreErrorHandlerMiddleware {
34
32
35
33
/**
36
34
* @param string|callable|null $renderer The renderer or class name
37
35
* to use or a callable factory.
38
36
* @param array $config Configuration options to use. If empty, `Configure::read('Error')`
39
37
* will be used.
40
38
*/
41
- public function __construct ($ renderer = null , array $ config = [])
42
- {
39
+ public function __construct ($ renderer = null , array $ config = []) {
43
40
// Only needed until CakePHP 3.4+ for BC reasons.
44
41
if ($ renderer === null ) {
45
42
$ renderer = Configure::read ('Error.exceptionRenderer ' );
@@ -48,14 +45,14 @@ public function __construct($renderer = null, array $config = [])
48
45
parent ::__construct ($ renderer , $ config );
49
46
}
50
47
51
- /**
52
- * Log an error for the exception if applicable.
53
- *
54
- * @param \Psr\Http\Message\ServerRequestInterface $request The current request.
55
- * @param \Exception $exception The exception to log a message for.
56
- * @return void
57
- */
58
- protected function logException ($ request , $ exception ) {
48
+ /**
49
+ * Log an error for the exception if applicable.
50
+ *
51
+ * @param \Psr\Http\Message\ServerRequestInterface $request The current request.
52
+ * @param \Exception $exception The exception to log a message for.
53
+ * @return void
54
+ */
55
+ protected function logException ($ request , $ exception ) {
59
56
$ blacklist = [
60
57
'Cake\Routing\Exception\MissingControllerException ' ,
61
58
'Cake\Routing\Exception\MissingActionException ' ,
@@ -80,7 +77,7 @@ protected function logException($request, $exception) {
80
77
return ;
81
78
}
82
79
83
- parent ::logException ($ request , $ exception );
84
- }
80
+ parent ::logException ($ request , $ exception );
81
+ }
85
82
86
83
}
0 commit comments