question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Decoding grpc-status-details-bin ?

See original GitHub issue

Hi 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:open
  • Created 5 years ago
  • Reactions:7
  • Comments:31 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
shumbocommented, May 11, 2021

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

4reactions
RXminuScommented, Apr 23, 2019

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?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found