dimas-b commented on code in PR #1159:
URL: https://github.com/apache/polaris/pull/1159#discussion_r1990187180


##########
service/common/src/main/java/org/apache/polaris/service/exception/IcebergExceptionMapper.java:
##########
@@ -223,39 +213,58 @@ public static int 
extractHttpCodeFromCloudException(Throwable t) {
     };
   }
 
-  static int mapCloudExceptionToResponseCode(Throwable t) {
-    if (doesAnyThrowableContainAccessDeniedHint(t)) {
-      return Status.FORBIDDEN.getStatusCode();
+  /**
+   * Tries mapping a cloud exception to the HTTP code that Polaris should 
return
+   *
+   * @param t the throwable/exception
+   * @return the HTTP code Polaris should return, if it was possible to return 
a suitable mapping.
+   *     Optional.empty() otherwise.
+   */
+  static Optional<Integer> mapCloudExceptionToResponseCode(Throwable t) {
+    // UnknownHostException isn't a RuntimeException so it's always wrapped
+    if (t instanceof UnknownHostException && 
t.getMessage().contains(AZURE_STORAGE_URL_SUFFIX)) {

Review Comment:
   restating comment from main thread: Is this `UnknownHostException` expected 
to be wrapped in an Azure SDK exception? If so, could we take that factor into 
our decision for the 404 (and drop the host name check)?



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