[ 
https://issues.apache.org/jira/browse/ARTEMIS-4267?focusedWorklogId=860487&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-860487
 ]

ASF GitHub Bot logged work on ARTEMIS-4267:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 04/May/23 08:17
            Start Date: 04/May/23 08:17
    Worklog Time Spent: 10m 
      Work Description: 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;
   ```





Issue Time Tracking
-------------------

    Worklog Id:     (was: 860487)
    Time Spent: 1.5h  (was: 1h 20m)

> Original exception lost for NoCacheLoginException
> -------------------------------------------------
>
>                 Key: ARTEMIS-4267
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-4267
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>            Reporter: Justin Bertram
>            Assignee: Justin Bertram
>            Priority: Major
>             Fix For: 2.29.0
>
>          Time Spent: 1.5h
>  Remaining Estimate: 0h
>
> When skipping the authentication cache the _original_ exception is not logged.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to