Skip to content

Commit

Permalink
nit
Browse files Browse the repository at this point in the history
  • Loading branch information
stephaniewang526 committed Mar 2, 2022
1 parent 3030f38 commit 81fcc27
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,23 +105,22 @@ private static StorageError toStorageError(com.google.rpc.Status rpcStatus) {
public static StorageException toStorageException(
com.google.rpc.Status rpcStatus, Throwable exception) {
StorageError error = toStorageError(rpcStatus);
Metadata metadata = Status.trailersFromThrowable(exception);
if (error == null) {
return null;
}
switch (error.getCode()) {
case STREAM_FINALIZED:
return new StreamFinalizedException(
Status.INVALID_ARGUMENT,
metadata,
null,
error.getEntity(),
error.getErrorMessage(),
exception);

case SCHEMA_MISMATCH_EXTRA_FIELDS:
return new SchemaMismatchedException(
Status.INVALID_ARGUMENT,
metadata,
null,
error.getEntity(),
error.getErrorMessage(),
exception);
Expand Down

0 comments on commit 81fcc27

Please sign in to comment.