Minor: Return exception instead of throwing it in .orElseThrow()

Gets rid of an IntelliJ warning about it. No difference in behavior, there is
a test that already covers this path.
This commit is contained in:
Ameya Lokare 2024-04-19 12:59:44 -07:00 committed by Jon Chambers
parent ed72d7f9ec
commit 2d314e5309
1 changed files with 1 additions and 1 deletions

View File

@ -87,7 +87,7 @@ public class CaptchaChecker {
final Action parsedAction = Action.parse(action)
.orElseThrow(() -> {
Metrics.counter(INVALID_ACTION_COUNTER_NAME, "action", action).increment();
throw new BadRequestException("invalid captcha action");
return new BadRequestException("invalid captcha action");
});
if (!parsedAction.equals(expectedAction)) {