[ https://issues.apache.org/jira/browse/THRIFT-5792?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Long Bui updated THRIFT-5792: ----------------------------- Description: Currently, the only way to retrieve IDL exceptions in Go is by using [ExtractExceptionFromResult|https://github.com/apache/thrift/blob/1405831722ac0e1e1ba100801bf21073a0d17940/lib/go/thrift/exception.go#L141], and as you can see, this method uses reflection to traverse through all fields. This is not an effective approach when the Result structure is large. Therefore, I propose adding an *Exception() error* method to the generated *Result* structure for retrieving IDL exceptions in an efficient way. was: Currently, the only way to retrieve IDL exceptions in Go is by using [ExtractExceptionFromResult|https://github.com/apache/thrift/blob/1405831722ac0e1e1ba100801bf21073a0d17940/lib/go/thrift/exception.go#L141], and as you can see, this method uses reflection to traverse through all fields. This is not an effective approach when the Result structure is large. Therefore, I propose adding an `Exception() error` method to the generated Result structure for retrieving IDL exceptions in an efficient way. > Generate a method for retrieving IDL exceptions in Go without using reflection > ------------------------------------------------------------------------------ > > Key: THRIFT-5792 > URL: https://issues.apache.org/jira/browse/THRIFT-5792 > Project: Thrift > Issue Type: Improvement > Components: Go - Compiler > Reporter: Long Bui > Priority: Trivial > > Currently, the only way to retrieve IDL exceptions in Go is by using > [ExtractExceptionFromResult|https://github.com/apache/thrift/blob/1405831722ac0e1e1ba100801bf21073a0d17940/lib/go/thrift/exception.go#L141], > and as you can see, this method uses reflection to traverse through all > fields. This is not an effective approach when the Result structure is large. > Therefore, I propose adding an *Exception() error* method to the generated > *Result* structure for retrieving IDL exceptions in an efficient way. -- This message was sent by Atlassian Jira (v8.20.10#820010)