[ https://issues.apache.org/jira/browse/THRIFT-5605?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17888477#comment-17888477 ]
Jens Geyer commented on THRIFT-5605: ------------------------------------ {code} // This is a special case, we want to make sure that the middleware don't // accidentally pull result as error. exception FooResponse { } service ClientMiddlewareExceptionTest { FooResponse foo() throws( // illegal return value 1: Exception1 error1, 2: Exception2 error2, ) } {code} > Go client middleware has no (easy) access to IDL exceptions > ----------------------------------------------------------- > > Key: THRIFT-5605 > URL: https://issues.apache.org/jira/browse/THRIFT-5605 > Project: Thrift > Issue Type: Bug > Components: Go - Library > Affects Versions: 0.16.0 > Reporter: Yuxuan Wang > Assignee: Yuxuan Wang > Priority: Minor > Fix For: 0.17.0 > > Time Spent: 1h > Remaining Estimate: 0h > > Similar to THRIFT-5527, this is the issue on the client side. > But unlike THRIFT-5527, this cannot be resolved by a fix on the compiler > code. We managed to write a [reflect based helper > function|https://github.com/reddit/baseplate.go/blob/e34b108af09beab61f33126dfacf075ff58f5116/thriftbp/client_middlewares.go#L404-L443] > to extract the IDL exceptions out of the result TStruct, I think upstream > that helper function to be a provided ClientMiddleware would be helpful. -- This message was sent by Atlassian Jira (v8.20.10#820010)