You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "mattisonchao (via GitHub)" <gi...@apache.org> on 2023/04/10 14:10:29 UTC
[GitHub] [pulsar] mattisonchao commented on a diff in pull request #20030: [fix][metrics] Fix the reason label of authentication metrics
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org