Package com.google.cloud.storage
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.google.cloud.BaseServiceException
com.google.cloud.BaseServiceException.Error, com.google.cloud.BaseServiceException.ExceptionData
-
Field Summary
Fields inherited from class com.google.cloud.http.BaseHttpServiceException
UNKNOWN_CODE
-
Constructor Summary
ConstructorDescriptionStorageException
(int code, String message) StorageException
(int code, String message, String reason, Throwable cause) StorageException
(int code, String message, Throwable cause) StorageException
(com.google.api.client.googleapis.json.GoogleJsonError error) StorageException
(IOException exception) -
Method Summary
Modifier and TypeMethodDescriptionstatic StorageException
translate
(IOException exception) Translate IOException to a StorageException representing the cause of the error.static StorageException
translateAndThrow
(com.google.cloud.RetryHelper.RetryHelperException ex) Translate RetryHelperException to the StorageException that caused the error.Methods inherited from class com.google.cloud.BaseServiceException
equals, getCode, getDebugInfo, getLocation, getReason, hashCode, isRetryable, isRetryable, isRetryable, translate, translate
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
StorageException
-
StorageException
-
StorageException
-
StorageException
-
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
- whenex
was caused by aStorageException
-
translate
Translate IOException to a StorageException representing the cause of the error. This method defaults to idempotent always beingtrue
. Additionally, this method translates transient issues Connection Closed Prematurely as a retryable error.- Returns:
StorageException
-