File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,9 @@ abstract class AbstractBounce
29
29
/** @var bool */
30
30
protected $ debug = false ;
31
31
32
+ /** @var bool */
33
+ protected $ displayErrors = false ;
34
+
32
35
/** @var LoggerInterface */
33
36
protected $ logger ;
34
37
@@ -60,6 +63,11 @@ public function setDebug(bool $debug)
60
63
$ this ->debug = $ debug ;
61
64
}
62
65
66
+ public function setDisplayErrors (bool $ displayErrors )
67
+ {
68
+ $ this ->displayErrors = $ displayErrors ;
69
+ }
70
+
63
71
protected function initLoggerHelper ($ logDirectoryPath , $ loggerName ): void
64
72
{
65
73
// Singleton for this function
@@ -112,12 +120,12 @@ protected function bounceCurrentIp()
112
120
$ this ->logger ->warning ('' , [
113
121
'type ' => 'UNKNOWN_EXCEPTION_WHILE_BOUNCING ' ,
114
122
'ip ' => $ ip ,
115
- 'messsage ' => $ e ->getMessage (),
123
+ 'message ' => $ e ->getMessage (),
116
124
'code ' => $ e ->getCode (),
117
125
'file ' => $ e ->getFile (),
118
126
'line ' => $ e ->getLine (),
119
127
]);
120
- if ($ this ->debug ) {
128
+ if ($ this ->displayErrors ) {
121
129
throw $ e ;
122
130
}
123
131
}
Original file line number Diff line number Diff line change @@ -363,12 +363,12 @@ public function safelyBounce(): void
363
363
} catch (\Exception $ e ) {
364
364
$ this ->logger ->error ('' , [
365
365
'type ' => 'EXCEPTION_WHILE_BOUNCING ' ,
366
- 'messsage ' => $ e ->getMessage (),
366
+ 'message ' => $ e ->getMessage (),
367
367
'code ' => $ e ->getCode (),
368
368
'file ' => $ e ->getFile (),
369
369
'line ' => $ e ->getLine (),
370
370
]);
371
- if ($ this ->debug ) {
371
+ if ($ this ->displayErrors ) {
372
372
throw $ e ;
373
373
}
374
374
} finally {
You can’t perform that action at this time.
0 commit comments