BewareMyPower commented on code in PR #18529:
URL: https://github.com/apache/pulsar/pull/18529#discussion_r1025978441


##########
pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authentication/AuthenticationService.java:
##########
@@ -107,6 +108,8 @@ public String authenticateHttpRequest(HttpServletRequest 
request, Authentication
                     LOG.debug("Authentication failed for provider " + 
providerToUse.getAuthMethodName() + " : "
                             + e.getMessage(), e);
                 }
+                // Store the exception so we can throw it later instead of a 
generic one
+                authenticationException = e;
                 throw e;

Review Comment:
   Notice here `e` is still thrown. So assigning `e` to 
`authenticationException` is meaningless because it cannot go to the logic 
later:
   
   ```java
               // it never reaches here because when authenticationException is 
not null,
               // the exception is still thrown and here it will be skipped
               if (authenticationException != null) {
                   throw authenticationException;
   ```



-- 
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