fishy commented on code in PR #2637:
URL: https://github.com/apache/thrift/pull/2637#discussion_r934960128
##########
lib/go/thrift/middleware.go:
##########
@@ -107,3 +110,76 @@ func WrapClient(client TClient, middlewares
...ClientMiddleware) TClient {
}
return client
}
+
+// For a endpoint defined in thrift IDL like this:
+//
+// service MyService {
+// FooResponse foo(1: FooRequest request) throws (
+// 1: Exception1 error1,
+// 2: Exception2 error2,
+// )
+// }
+//
+// The thrift compiler generated go code for the result TStruct would be like:
+//
+// type MyServiceFooResult struct {
+// Success *FooResponse `thrift:"success,0" db:"success"
json:"success,omitempty"`
+// Error1 *Exception1 `thrift:"error1,1" db:"error1"
json:"error1,omitempty"`
+// Error2 *Exception2 `thrift:"error2,2" db:"error2"
json:"error2,omitempty"`
+// }
+func getClientError(result TStruct, err error) error {
Review Comment:
@dcelasun I'm also debating whether to export this as a public API, and if
yes, what's a good name for it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]