Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: catch ExecutionException for op.getName #1729

Merged
merged 1 commit into from
Mar 5, 2022

Conversation

rajatbhatta
Copy link
Contributor

@rajatbhatta rajatbhatta commented Mar 4, 2022

Following exception is thrown:

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

So, changing the catch in order to catch all appropriate exceptions.

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #1652 ☕️

If you write sample code, please follow the samples format.

@rajatbhatta rajatbhatta requested a review from a team as a code owner March 4, 2022 05:55
@product-auto-label product-auto-label bot added the api: spanner Issues related to the googleapis/java-spanner API. label Mar 4, 2022
@rajatbhatta rajatbhatta self-assigned this Mar 4, 2022
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]>
@rajatbhatta rajatbhatta force-pushed the fix-cancelop-exception-handling branch from e017ad9 to e226252 Compare March 5, 2022 07:03
@rajatbhatta rajatbhatta changed the title fix: catch ExecutionException for cancelOperation fix: catch ExecutionException for op.getName Mar 5, 2022
@rajatbhatta rajatbhatta merged commit 8ea3ac0 into main Mar 5, 2022
@rajatbhatta rajatbhatta deleted the fix-cancelop-exception-handling branch March 5, 2022 07:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: spanner Issues related to the googleapis/java-spanner API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

spanner.it.slow.ITBackupTest: test02_RetryNonIdempotentRpcsReturningLongRunningOperations failed
2 participants