eric-maynard commented on code in PR #437:
URL: https://github.com/apache/polaris/pull/437#discussion_r1833518699


##########
polaris-service/src/main/java/org/apache/polaris/service/catalog/BasePolarisCatalog.java:
##########
@@ -2104,16 +2103,7 @@ private static boolean 
isStorageProviderRetryableException(Exception ex) {
   private static boolean isAccessDenied(String errorMsg) {
     // Corresponding error messages for storage providers Aws/Azure/Gcp
     boolean isAccessDenied =
-        errorMsg != null
-            && (errorMsg
-                    .toLowerCase(Locale.ENGLISH)
-                    .contains(IcebergExceptionMapper.AWS_ACCESS_DENIED_HINT)
-                || errorMsg
-                    .toLowerCase(Locale.ENGLISH)
-                    .contains(IcebergExceptionMapper.AZURE_ACCESS_DENIED_HINT)
-                || errorMsg
-                    .toLowerCase(Locale.ENGLISH)
-                    .contains(IcebergExceptionMapper.GCP_ACCESS_DENIED_HINT));
+        errorMsg != null && 
IcebergExceptionMapper.containsAnyAccessDeniedHint(errorMsg);

Review Comment:
   Did we lose the lower-casing?



##########
polaris-service/src/main/java/org/apache/polaris/service/exception/IcebergExceptionMapper.java:
##########
@@ -128,9 +128,18 @@ case StorageException e when 
doesAnyThrowableContainInsensitive(
    * @return whether any throwable in the exception chain 
case-insensitive-contains the given
    *     message
    */
-  static boolean doesAnyThrowableContainInsensitive(Exception e, String 
message) {
-    String messageLower = message.toLowerCase(Locale.ENGLISH);
+  static boolean doesAnyThrowableContainAccessDeniedHint(Exception e) {
     return Arrays.stream(ExceptionUtils.getThrowables(e))
-        .anyMatch(t -> 
t.getMessage().toLowerCase(Locale.ENGLISH).contains(messageLower));
+        .anyMatch(t -> containsAnyAccessDeniedHint(t.getMessage()));
+  }
+
+  public static boolean containsAnyAccessDeniedHint(String message) {
+    String messageLower = message.toLowerCase(Locale.ENGLISH);

Review Comment:
   Nevermind, found it!



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