Skip to content

Commit 8ea3ac0

Browse files
fix: catch ExecutionException for op.getName (#1729)
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 <koloite@gmail.com>
1 parent bc734ce commit 8ea3ac0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/slow/ITBackupTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ public void test02_RetryNonIdempotentRpcsReturningLongRunningOperations() throws
467467
}
468468
try {
469469
client.cancelOperation(op.getName());
470-
} catch (SpannerException e) {
470+
} catch (SpannerException | ExecutionException e) {
471471
// Ignore, this can happen, as the restore operation sometimes fails to start if there
472472
// is already a restore operation running on the instance.
473473
}

0 commit comments

Comments
 (0)