Class Exceptions (3.10.2)

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
Name Description
rpcStatus com.google.rpc.Status
exception Throwable
Returns
Type Description
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
Name Description
exception Throwable
Returns
Type Description
Exceptions.StorageException