OK status is not designed to include error messages. Other options are: - Send it in the response - Send RPC trailer metadata (example: https://github.com/grpc/grpc/tree/master/examples/cpp/metadata)
On Thursday, September 3, 2020 at 3:49:08 AM UTC-7 [email protected] wrote: > Sometimes, I want to return a Status::OK but with a custom message in > error_message(). I cannot extract the error_message in a Status::OK from > client. I have to change the server to return some random error like > UNKNOWN, OUT_OF_RANGE to read error_message() from the server. > tldr; How can I extract error_message() from a StatusCode::OK in client? > -- 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 view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/2900be8f-1c0c-4818-bb1a-526a43c0da56n%40googlegroups.com.
