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

Add StatusProto.toStatusException overload to accept Throwable #11083

Merged
merged 4 commits into from
Apr 25, 2024

Conversation

rtadepalli
Copy link
Contributor

Fixes #10900

Copy link

linux-foundation-easycla bot commented Apr 7, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

@rtadepalli
Copy link
Contributor Author

cc @ejona86

@rtadepalli rtadepalli requested a review from ejona86 April 16, 2024 03:22
@@ -176,6 +176,15 @@ public void fromThrowable_shouldReturnNullIfNoEmbeddedStatus() {
assertNull(StatusProto.fromThrowable(nestedSe));
}

@Test
public void toStatusExceptionWithMetadataAndCause_shouldCaptureCause() {
RuntimeException exc = new RuntimeException("This is a test exception.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably rename exc -> cause

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, ex, exception, cause, etc would be more common, but we can live with this.

@ejona86 ejona86 added the kokoro:run Add this label to a PR to tell Kokoro the code is safe and tests can be run label Apr 16, 2024
@grpc-kokoro grpc-kokoro removed the kokoro:run Add this label to a PR to tell Kokoro the code is safe and tests can be run label Apr 16, 2024
@ejona86 ejona86 added the kokoro:run Add this label to a PR to tell Kokoro the code is safe and tests can be run label Apr 24, 2024
@grpc-kokoro grpc-kokoro removed the kokoro:run Add this label to a PR to tell Kokoro the code is safe and tests can be run label Apr 24, 2024
@larry-safran larry-safran merged commit 5c9b492 into grpc:master Apr 25, 2024
13 checks passed
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ability to propagate cause when using StatusProto.toStatusException
5 participants