In the Google protocol buffers, what protocol file / model for exceptions?

Protocol buffers do not have a native exception type. What does a suitable .proto file look for cross language exceptions?

+6
java python php exception protocol-buffers
source share
1 answer

Protocol Buffer Technical Management, Kenton Varda, says in comment 9 on this blog post :

If you need to return structured errors, then the right way to do this is to make your type of response able to present this information ... We felt that support for exceptions would clearly add too many complications to a small real gain.

This makes sense, given that if you want to return detailed error information, .proto ads will vary depending on the situation. If you want to get very general exceptions (just a string message), then the basic RPC mechanism can provide this already, for example. HTTP status.

+5
source share

All Articles