Skip to content

Commit

Permalink
fix: catch ExecutionException for op.getName (#1729)
Browse files Browse the repository at this point in the history
Following exception is thrown:

java.util.concurrent.ExecutionException: com.google.api.gax.rpc.FailedPreconditionException: io.grpc.StatusRuntimeException: FAILED_PRECONDITION.

So, changing the catch to catch ExecutionException as well.

Catch both SpannerException and ExecutionException.

Co-authored-by: Knut Olav Løite <[email protected]>
  • Loading branch information
rajatbhatta and olavloite authored Mar 5, 2022
1 parent bc734ce commit 8ea3ac0
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ public void test02_RetryNonIdempotentRpcsReturningLongRunningOperations() throws
}
try {
client.cancelOperation(op.getName());
} catch (SpannerException e) {
} catch (SpannerException | ExecutionException e) {
// Ignore, this can happen, as the restore operation sometimes fails to start if there
// is already a restore operation running on the instance.
}
Expand Down

0 comments on commit 8ea3ac0

Please sign in to comment.