brusdev commented on code in PR #4461:
URL: https://github.com/apache/activemq-artemis/pull/4461#discussion_r1184679690


##########
artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/security/jaas/LDAPLoginModule.java:
##########
@@ -262,9 +262,9 @@ public boolean commit() throws LoginException {
    }
 
    private LoginException handleException(LoginException e) {
-      Throwable t = ExceptionUtil.getRootCause(e);
-      if (noCacheExceptions.contains(t.getClass().getName())) {
-         t.initCause(new NoCacheLoginException());
+      Throwable rootCause = ExceptionUtils.getRootCause(e);
+      if (noCacheExceptions.contains(rootCause.getClass().getName())) {
+         rootCause.initCause(new 
NoCacheLoginException(rootCause.getClass().getName() + (rootCause.getMessage() 
== null ? "" : ": " + rootCause.getMessage())));
       }
       return e;

Review Comment:
   LDAPLoginModule could throw NoCacheLoginException caused by LoginException
   ```suggestion
         Throwable rootCause = ExceptionUtils.getRootCause(e);
         if (noCacheExceptions.contains(rootCause.getClass().getName())) {
            NoCacheLoginException noCacheLoginException = new 
NoCacheLoginException(rootCause.getClass().getName() + (rootCause.getMessage() 
== null ? "" : ": " + rootCause.getMessage())));
            noCacheLoginException.initCause(e);
            return noCacheLoginException;
         }
         return e;
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to