log stacktrace of failed api token parsing only if trace is enabled

This commit is contained in:
Sebastian Sdorra
2020-10-22 14:46:40 +02:00
parent 7b91cf82bf
commit 86b4dfb92a

View File

@@ -62,7 +62,10 @@ class ApiKeyTokenHandler {
try {
return of(OBJECT_MAPPER.readValue(decoder.decode(token), Token.class));
} catch (IOException e) {
LOG.debug("failed to read api token, perhaps it is a jwt token or a normal password", e);
LOG.debug("failed to read api token, perhaps it is a jwt token or a normal password");
if (LOG.isTraceEnabled()) {
LOG.trace("failed to parse token", e);
}
return empty();
}
}