Only log for an unexpected error from the key transparency service

This commit is contained in:
Katherine 2025-06-24 14:45:53 -04:00 committed by GitHub
parent 059caa4c57
commit c2b8fdac0d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 4 deletions

View File

@ -111,7 +111,6 @@ public class KeyTransparencyController {
request.distinguishedTreeHeadSize()) request.distinguishedTreeHeadSize())
.toByteArray()); .toByteArray());
} catch (final StatusRuntimeException exception) { } catch (final StatusRuntimeException exception) {
LOGGER.error("Unexpected error calling key transparency service", exception);
handleKeyTransparencyServiceError(exception); handleKeyTransparencyServiceError(exception);
} }
// This is unreachable // This is unreachable
@ -172,7 +171,6 @@ public class KeyTransparencyController {
request.lastDistinguishedTreeHeadSize()) request.lastDistinguishedTreeHeadSize())
.toByteArray()); .toByteArray());
} catch (final StatusRuntimeException exception) { } catch (final StatusRuntimeException exception) {
LOGGER.error("Unexpected error calling key transparency service", exception);
handleKeyTransparencyServiceError(exception); handleKeyTransparencyServiceError(exception);
} }
// This is unreachable // This is unreachable
@ -210,7 +208,6 @@ public class KeyTransparencyController {
keyTransparencyServiceClient.getDistinguishedKey(lastTreeHeadSize) keyTransparencyServiceClient.getDistinguishedKey(lastTreeHeadSize)
.toByteArray()); .toByteArray());
} catch (final StatusRuntimeException exception) { } catch (final StatusRuntimeException exception) {
LOGGER.error("Unexpected error calling key transparency service", exception);
handleKeyTransparencyServiceError(exception); handleKeyTransparencyServiceError(exception);
} }
// This is unreachable // This is unreachable
@ -224,7 +221,10 @@ public class KeyTransparencyController {
case NOT_FOUND -> throw new NotFoundException(description); case NOT_FOUND -> throw new NotFoundException(description);
case PERMISSION_DENIED -> throw new ForbiddenException(description); case PERMISSION_DENIED -> throw new ForbiddenException(description);
case INVALID_ARGUMENT -> throw new WebApplicationException(description, 422); 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);
}
} }
} }