Thanks to visit codestin.com
Credit goes to Github.com

Skip to content

Conversation

@pskopek
Copy link
Contributor

@pskopek pskopek commented Feb 11, 2026

Adding the log to the required action to show the cause of syntax violation of the LDAP policy

Closes #44459

@pskopek pskopek requested a review from a team as a code owner February 11, 2026 16:21
Copy link
Contributor

@mposolda mposolda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pskopek Thanks for the PR. Added a comment inline (probably related to test failures).

throw ErrorResponse.error(e.getMessage(), Response.Status.INTERNAL_SERVER_ERROR);
} catch (ModelException e) {
logger.warn("Could not update user password.", e);
logger.warnf("Could not update password for user %s. Reason: %s", user.getUsername(), e.getCause().getMessage());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that test failures are regression of this change.

I guess that e.getCause() is sometimes null? So perhaps might be rather something to check nulls. IMO it would be also good to still log original exception at least at the trace level as it is sometimes useful to see the whole trace for debugging/investigating the cause of some particular issue.

Suggested change
logger.warnf("Could not update password for user %s. Reason: %s", user.getUsername(), e.getCause().getMessage());
String exceptionMessage = e.getCause() == null ? e.getMessage() : e.getCause().getMessage();
logger.warnf("Could not update password for user %s. Reason: %s", user.getUsername(), exceptionMessage);
if (log.isTraceEnabled()) {
log.tracef("Could not update user password.", e);
}

@mposolda mposolda self-assigned this Feb 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Adding the log to the required action to show the cause of syntax violation of the LDAP policy

2 participants