vyommani commented on code in PR #872:
URL: https://github.com/apache/ranger/pull/872#discussion_r3145973038


##########
plugin-kms/src/main/java/org/apache/ranger/services/kms/client/KMSClient.java:
##########
@@ -274,21 +273,10 @@ public List<String> getKeyList(final String 
keyNameMatching, final List<String>
 
                             return lret;
                         }
-                    } else if (response.getStatus() == 401) {
-                        LOG.info("getKeyList():response.getStatus()= {} for 
URL {}, so returning null list", response.getStatus(), uri);
-
-                        String          msgDesc      = 
response.getEntity(String.class);
-                        HadoopException hdpException = new 
HadoopException(msgDesc);
-
-                        hdpException.generateResponseDataMap(false, msgDesc, 
msgDesc + ERROR_MSG, null, null);
-
-                        lret = null;
-
-                        throw hdpException;
-                    } else if (response.getStatus() == 403) {
+                    } else if (response.getStatus() == 401 || 
response.getStatus() == 403) {

Review Comment:
   good refactor. Both 401 and 403 are 4xx client auth errors and had identical 
handling before, so combining them removes duplication with no behavior change.



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