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

Decode grpc-status-details-bin and add it to GrpcException #2352

Closed
wants to merge 1 commit into from

Conversation

Hexcles
Copy link

@Hexcles Hexcles commented Nov 17, 2022

Only attempt to base64-decode it when there's no transport error. An invalid base64 value will be treated as IOException.

It is up to the user to unmarshal it into a string if desired.

This is a de-facto standard used by grpc:
https://groups.google.com/g/grpc-io/c/p_gCk1bn2JE

Note that this is not included into responseMetadata because gRPC metadata must not include reserved names grpc-* per spec: https://grpc.io/docs/what-is-grpc/core-concepts/#metadata In other words, by definition this is not "metadata".

Fixes #2343.

Only attempt to base64-decode it when there's no transport error. An
invalid base64 value will be treated as IOException.

It is up to the user to unmarshal it into a string if desired.

This is a de-facto standard used by grpc:
https://groups.google.com/g/grpc-io/c/p_gCk1bn2JE

Note that this is *not* included into `responseMetadata` because gRPC
metadata must not include reserved names `grpc-*` per spec:
https://grpc.io/docs/what-is-grpc/core-concepts/#metadata
In other words, by definition this is not "metadata".

Fixes square#2343.
@oldergod
Copy link
Member

Thanks @Hexcles , you think you could write a test for this?

@Hexcles
Copy link
Author

Hexcles commented Nov 18, 2022 via email

@oldergod
Copy link
Member

oldergod commented Nov 18, 2022

We do not have a dev setup doc unfortunately. It's been a pain to build Wire for a while specially since we went MPP + included projects. We'll flatten the project soon which should help some of those hopefully.
CI says there's a compilation error right now:

e: /Users/runner/work/wire/wire/wire-library/wire-grpc-client/src/commonMain/kotlin/com/squareup/wire/GrpcException.kt: (23, 27): Expecting comma or ')'

For the xcrun stuff I don't recall. Might need to install the Xcode Command Line Tools.

@Hexcles
Copy link
Author

Hexcles commented Feb 18, 2023

Replaced by #2408

@Hexcles Hexcles closed this Feb 18, 2023
@Hexcles Hexcles deleted the grpc-status-details-bin branch February 18, 2023 21:08
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.

Include grpc-status-details-bin in GrpcException
2 participants