Class IcebergExceptionMapper

java.lang.Object
org.apache.polaris.service.exception.IcebergExceptionMapper
All Implemented Interfaces:
jakarta.ws.rs.ext.ExceptionMapper<RuntimeException>

@Provider public class IcebergExceptionMapper extends Object implements jakarta.ws.rs.ext.ExceptionMapper<RuntimeException>
  • Field Details

    • UNKNOWN_CLOUD_HTTP_CODE

      public static final int UNKNOWN_CLOUD_HTTP_CODE
      Signifies that we could not extract an HTTP code from a given cloud exception
      See Also:
    • RETRYABLE_AZURE_HTTP_CODES

      public static final Set<Integer> RETRYABLE_AZURE_HTTP_CODES
  • Constructor Details

    • IcebergExceptionMapper

      public IcebergExceptionMapper()
  • Method Details

    • toResponse

      public jakarta.ws.rs.core.Response toResponse(RuntimeException runtimeException)
      Specified by:
      toResponse in interface jakarta.ws.rs.ext.ExceptionMapper<RuntimeException>
    • containsAnyAccessDeniedHint

      public static boolean containsAnyAccessDeniedHint(String message)
    • isStorageProviderRetryableException

      public static boolean isStorageProviderRetryableException(Throwable t)
      Check if the Throwable is retryable for the storage provider
      Parameters:
      t - the Throwable
      Returns:
      true if the Throwable is retryable
    • getAccessDeniedHints

      public static Collection<String> getAccessDeniedHints()
    • extractHttpCodeFromCloudException

      public static int extractHttpCodeFromCloudException(Throwable t)
      We typically call cloud providers over HTTP, so when there's an exception there's typically an associated HTTP code. This extracts the HTTP code if possible.
      Parameters:
      t - The cloud provider throwable
      Returns:
      UNKNOWN_CLOUD_HTTP_CODE if the throwable is not a cloud exception that we know how to extract the code from