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 authored and Jon Chambers committed 2024-04-22 09:32:12 -04:00
1 parent ed72d7f9ec
commit d39abc3008
1 file changed
+1 -1
@@ -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)) {