You can use the utility method StatusProto#fromThrowable
<https://github.com/grpc/grpc-java/blob/6cf8f059c93c684479af59b79f192e43daadb433/protobuf/src/main/java/io/grpc/protobuf/StatusProto.java#L144>
to
extract the error details as a com.google.rpc.Status proto. Metadata keys
beginning with "grpc-" are intended for internal use by the gRPC library,
so the Metaday.Key itself is not public.

Thanks,

Eric

On Fri, May 12, 2017 at 8:17 AM, Przemysław Sobala <
[email protected]> wrote:

> Hi, how to use error_details send from server via (C++):
>
> grpc::ServerAsyncResponseWriter<?>::FinishWithError(Status(StatusCode code
> , const grpc::string& error_message, *const grpc::string& error_details*))
>
> to java client, other than using (Java):
>
> Metadata m = Status.trailersFromThrowable(t);
> byte[] error_details = m.get(Metadata.Key.of("grpc-status-details-bin",
> Metadata.BINARY_BYTE_MARSHALLER));
>
> That key, that I have to pass,  -  "grpc-status-details-bin" - is
> bothering me the most. Should it be accessible via some Java API?
> --
> regards
> Przemysław Sobala
>
> --
> You received this message because you are subscribed to the Google Groups "
> grpc.io" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/grpc-io.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/grpc-io/953bee4b-c263-481d-a7fe-3441a2ecb560%40googlegroups.com
> <https://groups.google.com/d/msgid/grpc-io/953bee4b-c263-481d-a7fe-3441a2ecb560%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/CALUXJ7jPigG8MVzYinae-aydSv1G2MQEyLowPLQwZtOgULwJhg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to