[ 
https://issues.apache.org/jira/browse/THRIFT-1168?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Vitali Lovich updated THRIFT-1168:
----------------------------------

    Attachment: 0001-Fix-bug-when-void-function-can-throw-an-exception.patch

Tested that this fixes the issue.  Should also improve performance since the 
exception was being always serialized in the result.
                
> C++ cob client/server: void functions that throw exceptions
> -----------------------------------------------------------
>
>                 Key: THRIFT-1168
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1168
>             Project: Thrift
>          Issue Type: Bug
>          Components: C++ - Compiler
>    Affects Versions: 0.6.1
>            Reporter: NewBlood
>         Attachments: 
> 0001-Fix-bug-when-void-function-can-throw-an-exception.patch
>
>
> Suppose you have a void function that can throw an exception in your Thrift 
> definition:
> exception Error {
>   1: string desc;
> }
> service Aggr {
>   void addValue(1: i32 value) throws (1: Error err);
> }
> When the CobClient calls recv_addValue() to process the response from the 
> server, recv_addValue() _always_ says that the server threw an exception.
> This is due to the way the code is generated - aggr_addValue_presult::write() 
> always writes a "err" struct which contains a "desc" even if no exception was 
> thrown, and the cob client's recv_addValue() thinks that an exception is 
> thrown.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to