On Tuesday, March 30, 2021 at 1:00:21 AM UTC-7 Vivek wrote:

> As I mentioned the Trailer approach comes with some caveats. Hence, I
> wanted to know if there is a better way to do this esp. Fault Contract
> approach mentioned here:
> 
https://docs.microsoft.com/en-us/dotnet/architecture/grpc-for-wcf-developers/error-handling#grpc-richer-error-model

No, there is nothing built in to either gRPC or Protocol Buffers for
_explicitly modeling faults_ à la SOAP.

As you've found, there are caveats to the rich error model. Only you can
determine whether this approach will work for your software or not. Whatever
you decide, for the sake of your consumers, please explicitly document it.
And test your error cases. :-)

If you are consuming another gRPC API, you will have to consult its
documentation to determine how it models faults.

I've worked on projects that were able to use the rich error model, as we
could handle the caveats. We controlled all the clients, proxies, and
servers. We had two languages, and we wrote helpers to encode and extract
the rich error information. We taught our custom HTTP monitoring components
how to understand gRPC errors. &c.

--
Christopher Warrington
Microsoft Corp.

-- 
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 grpc-io+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/3fc32f82-d887-4ae3-9437-dbb210ddabf4n%40googlegroups.com.

Reply via email to