From c2b8fdac0d75028669e4378d0e402ad9bef232ec Mon Sep 17 00:00:00 2001 From: Katherine Date: Tue, 24 Jun 2025 14:45:53 -0400 Subject: [PATCH] Only log for an unexpected error from the key transparency service --- .../controllers/KeyTransparencyController.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/KeyTransparencyController.java b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/KeyTransparencyController.java index adb8c465d..d24d491f5 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/KeyTransparencyController.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/KeyTransparencyController.java @@ -111,7 +111,6 @@ public class KeyTransparencyController { request.distinguishedTreeHeadSize()) .toByteArray()); } catch (final StatusRuntimeException exception) { - LOGGER.error("Unexpected error calling key transparency service", exception); handleKeyTransparencyServiceError(exception); } // This is unreachable @@ -172,7 +171,6 @@ public class KeyTransparencyController { request.lastDistinguishedTreeHeadSize()) .toByteArray()); } catch (final StatusRuntimeException exception) { - LOGGER.error("Unexpected error calling key transparency service", exception); handleKeyTransparencyServiceError(exception); } // This is unreachable @@ -210,7 +208,6 @@ public class KeyTransparencyController { keyTransparencyServiceClient.getDistinguishedKey(lastTreeHeadSize) .toByteArray()); } catch (final StatusRuntimeException exception) { - LOGGER.error("Unexpected error calling key transparency service", exception); handleKeyTransparencyServiceError(exception); } // This is unreachable @@ -224,7 +221,10 @@ public class KeyTransparencyController { case NOT_FOUND -> throw new NotFoundException(description); case PERMISSION_DENIED -> throw new ForbiddenException(description); case INVALID_ARGUMENT -> throw new WebApplicationException(description, 422); - default -> throw new ServerErrorException(Response.Status.INTERNAL_SERVER_ERROR, exception); + default -> { + LOGGER.error("Unexpected error calling key transparency service", exception); + throw new ServerErrorException(Response.Status.INTERNAL_SERVER_ERROR, exception); + } } }