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

feat: Better name for rich status metadata, better details lookup API #1740

Merged
merged 1 commit into from
Dec 21, 2022

Conversation

johanandren
Copy link
Member

Follow up to #1665

@johanandren johanandren requested a review from ennru December 21, 2022 13:42
@@ -67,13 +65,13 @@ public void testNativeApi() throws Exception {
}).get();

GrpcServiceException ex = GrpcServiceException.apply(statusRuntimeException);
RichMetadata meta = (RichMetadata) ex.getMetadata();
MetadataStatus meta = (MetadataStatus) ex.getMetadata();
Copy link
Member Author

Choose a reason for hiding this comment

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

Went with status since that is the google rpc name of it

def getCode(): Int
def getMessage(): String
def getDetails(): List[com.google.protobuf.any.Any]
def getParsedDetails[K <: scalapb.GeneratedMessage](index: Int, companion: scalapb.GeneratedMessageCompanion[K]): K
def getParsedDetails[K <: scalapb.GeneratedMessage](companion: scalapb.GeneratedMessageCompanion[K]): List[K]
Copy link
Member Author

Choose a reason for hiding this comment

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

Likely contain only one of each type, but it's also possible with many, LocalizedMessage would be one per language for example.

Copy link
Member

@ennru ennru left a comment

Choose a reason for hiding this comment

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

LGTM.

@johanandren johanandren merged commit 40fb2f2 into main Dec 21, 2022
@johanandren johanandren deleted the wip-rich-error-model-for-client-follow-up branch December 21, 2022 15:54
@johanandren johanandren added this to the 2.3.0-M2 milestone Dec 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants