mattisonchao commented on code in PR #20030:
URL: https://github.com/apache/pulsar/pull/20030#discussion_r1161752440


##########
pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authentication/AuthenticationProviderBasic.java:
##########
@@ -104,10 +105,11 @@ public String authenticate(AuthenticationDataSource 
authData) throws Authenticat
         String userId = authParams.getUserId();
         String password = authParams.getPassword();
         String msg = "Unknown user or invalid password";
+        ErrorCode errorCode = ErrorCode.BASIC_INVALID_AUTH_DATA;
 
         try {
             if (users.get(userId) == null) {
-                throw new AuthenticationException(msg);
+                throw new PulsarAuthenticationException(msg, errorCode);

Review Comment:
   IMO, use `ErrorCode.BASIC_INVALID_AUTH_DATA` directly will be more clear. :)



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