From 2d314e53094b58bfb8b5546ecf83c356d999176c Mon Sep 17 00:00:00 2001 From: Ameya Lokare Date: Fri, 19 Apr 2024 12:59:44 -0700 Subject: [PATCH] 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. --- .../whispersystems/textsecuregcm/captcha/CaptchaChecker.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/captcha/CaptchaChecker.java b/service/src/main/java/org/whispersystems/textsecuregcm/captcha/CaptchaChecker.java index 954f3dd7e..974a919fe 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/captcha/CaptchaChecker.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/captcha/CaptchaChecker.java @@ -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)) {