Do not log when failure.getError is blank/empty
Sometimes the error message is blank, which results in an empty error line getting logged. Since the catch always logs "failed to turn code into token" and "status from server: " + failure.getStatus() (on separate lines) this extra blank line is simply noise in the log.
This commit is contained in:
parent
e07fd9ffa3
commit
6c83b36360
1 changed files with 1 additions and 1 deletions
|
@ -336,7 +336,7 @@ public class OAuthRequestAuthenticator {
|
||||||
} catch (ServerRequest.HttpFailure failure) {
|
} catch (ServerRequest.HttpFailure failure) {
|
||||||
log.error("failed to turn code into token");
|
log.error("failed to turn code into token");
|
||||||
log.error("status from server: " + failure.getStatus());
|
log.error("status from server: " + failure.getStatus());
|
||||||
if (failure.getError() != null) {
|
if (failure.getError() != null && !failure.getError().isBlank()) {
|
||||||
log.error(" " + failure.getError());
|
log.error(" " + failure.getError());
|
||||||
}
|
}
|
||||||
return challenge(403, OIDCAuthenticationError.Reason.CODE_TO_TOKEN_FAILURE, null);
|
return challenge(403, OIDCAuthenticationError.Reason.CODE_TO_TOKEN_FAILURE, null);
|
||||||
|
|
Loading…
Reference in a new issue