eric-maynard commented on code in PR #402:
URL: https://github.com/apache/polaris/pull/402#discussion_r1814016737
##########
polaris-service/src/main/java/org/apache/polaris/service/exception/IcebergExceptionMapper.java:
##########
@@ -100,4 +103,27 @@ public Response toResponse(RuntimeException
runtimeException) {
LOGGER.debug("Mapped exception to errorResp: {}", errorResp);
return errorResp;
}
+
+ public static boolean isAccessDenied(String errorMsg) {
+ // Corresponding error messages for storage providers Aws/Azure/Gcp
+ // We may want to consider a change to Iceberg Core to wrap cloud provider
IO exceptions to
+ // Iceberg ForbiddenException
+ boolean isAccessDenied =
+ errorMsg != null
+ && (errorMsg.toLowerCase(Locale.ENGLISH).contains("access denied")
+ || errorMsg
+ .toLowerCase(Locale.ENGLISH)
+ .contains("this request is not authorized to perform this
operation")
+ || errorMsg.toLowerCase(Locale.ENGLISH).contains("forbidden"));
Review Comment:
It might be good to explicitly label these strings (e.g.
`AWS_ACCESS_DENIED_HINT = "access denied"`) to make future maintenance easier
--
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]