Skip to content

Commit adf3924

Browse files
feat(error handling): Use a specific BouncerException for some error
1 parent 2e9b269 commit adf3924

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/StandAloneBounce.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public function getBouncerInstance(): Bouncer
121121
$maxRemediationLevel = Constants::REMEDIATION_BAN;
122122
break;
123123
default:
124-
throw new \Exception("Unknown $bouncingLevel");
124+
throw new BouncerException("Unknown $bouncingLevel");
125125
}
126126

127127
// Instanciate the bouncer
@@ -343,7 +343,7 @@ public function sendResponse(?string $body, int $statusCode = 200): void
343343
header('Pragma: no-cache');
344344
break;
345345
default:
346-
throw new \Exception("Unhandled code ${statusCode}");
346+
throw new BouncerException("Unhandled code $statusCode");
347347
}
348348
if (null !== $body) {
349349
echo $body;

0 commit comments

Comments
 (0)