Class Exceptions (2.47.0)

public final class Exceptions

Exceptions for Storage Client Libraries.

Inheritance

java.lang.Object > Exceptions

Static Methods

toStorageException(Status rpcStatus, Throwable exception)

public static Exceptions.StorageException toStorageException(Status rpcStatus, Throwable exception)

Converts a c.g.rpc.Status into a StorageException, if possible. Examines the embedded StorageError, and potentially returns a StreamFinalizedException or SchemaMismatchedException (both derive from StorageException). If there is no StorageError, or the StorageError is a different error it will return NULL.

Parameters
NameDescription
rpcStatuscom.google.rpc.Status
exceptionThrowable
Returns
TypeDescription
Exceptions.StorageException

toStorageException(Throwable exception)

public static Exceptions.StorageException toStorageException(Throwable exception)

Converts a Throwable into a StorageException, if possible. Examines the embedded error message, and potentially returns a StreamFinalizedException or SchemaMismatchedException (both derive from StorageException). If there is no StorageError, or the StorageError is a different error it will return NULL.

Parameter
NameDescription
exceptionThrowable
Returns
TypeDescription
Exceptions.StorageException