Skip to content

Commit c76968b

Browse files
feat(exception): Chain exception when possible
1 parent 673fffd commit c76968b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/AbstractBouncer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ public function getRemediationForIp(string $ip): string
162162
try {
163163
return $this->capRemediationLevel($this->getRemediationEngine()->getIpRemediation($ip));
164164
} catch (\Exception $e) {
165-
throw new BouncerException($e->getMessage());
165+
throw new BouncerException($e->getMessage(), $e->getCode(), $e);
166166
}
167167
}
168168

@@ -227,7 +227,7 @@ public function run(): bool
227227
'line' => $e->getLine(),
228228
]);
229229
if (true === $this->getConfig('display_errors')) {
230-
throw new BouncerException($e->getMessage());
230+
throw new BouncerException($e->getMessage(), $e->getCode(), $e);
231231
}
232232
}
233233

0 commit comments

Comments
 (0)