Class StorageException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.google.cloud.BaseServiceException
com.google.cloud.http.BaseHttpServiceException
com.google.cloud.storage.StorageException
All Implemented Interfaces:
Serializable

@InternalApi public final class StorageException extends com.google.cloud.http.BaseHttpServiceException
Storage service exception.
See Also:
  • Constructor Details

    • StorageException

      public StorageException(int code, String message)
    • StorageException

      public StorageException(int code, String message, Throwable cause)
    • StorageException

      public StorageException(int code, String message, String reason, Throwable cause)
    • StorageException

      public StorageException(IOException exception)
    • StorageException

      public StorageException(com.google.api.client.googleapis.json.GoogleJsonError error)
  • Method Details

    • translateAndThrow

      public static StorageException translateAndThrow(com.google.cloud.RetryHelper.RetryHelperException ex)
      Translate RetryHelperException to the StorageException that caused the error. This method will always throw an exception.
      Throws:
      StorageException - when ex was caused by a StorageException
    • translate

      public static StorageException translate(IOException exception)
      Translate IOException to a StorageException representing the cause of the error. This method defaults to idempotent always being true. Additionally, this method translates transient issues Connection Closed Prematurely as a retryable error.
      Returns:
      StorageException