Decoding grpc-status-details-bin ?
See original GitHub issueHi there
Server side, we send an error withDetails (in GO) :
st2 := status.New(codes.Aborted, "failed to map")
st2.WithDetails(&Error{
Code: 1,
Message: "error",
})
Client side (js / typescript), we need to retrieve these details somehow but all we receive is a serialized string (trailers.get('grpc-status-details-bin')
) … how can we decode it ?
Thanks
Issue Analytics
- State:
- Created 5 years ago
- Reactions:7
- Comments:31 (1 by maintainers)
Top Results From Across the Web
Question about sending big error messages via "grpc-status ...
An error in the response is sent not in the body, but in the "grpc-status-details-bin" header, which is why, if the error is...
Read more >Richer Error Handling Over gRPC in Go and Rust
It turns out that it contains an encoding of the Status protobuf message above. That is, a Status has a field called details...
Read more >Status - Go Packages
Details returns a slice of details messages attached to the status. If a detail cannot be decoded, the error is returned in place...
Read more >gRPC over HTTP2
The following is the general sequence of message atoms in a GRPC request ... END_HEADERS) grpc-status = 0 # OK trace-proto-bin = jher831yy13JHy3hc ......
Read more >GRPC Core: Status codes and their use in gRPC
Code Number Description
OK 0 Not an error; returned on success.
FAILED_PRECONDITION 9
OUT_OF_RANGE 11
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’ve created an NPM package to deserialize
grpc-status-details-bin
header. Please check it out if you’re still looking for a solution.https://github.com/shumbo/grpc-web-error-details
We have the same problem, expected to have
grpc-status-details-bin
decoded into Status details. Should be a relatively easy fix though as suggested by @jesushernandez ; just checking if the header exists and deserializing the blob into the correct object.I might have time for a PR next week if @jesushernandez hasn’t started yet? Otherwise, I might put up a git bounty instead if anyone wants to join?