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

venkata yerubandi updated THRIFT-1601:
--------------------------------------

    Summary: thrift clients generated for python checks if success is set first 
before checking if an exception is set   (was: thrift clients generated for 
python check if success is set first before checking if an exception is set )
    
> thrift clients generated for python checks if success is set first before 
> checking if an exception is set 
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: THRIFT-1601
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1601
>             Project: Thrift
>          Issue Type: Bug
>          Components: Python - Compiler
>    Affects Versions: 0.8
>         Environment: ubuntu 10.04 
>            Reporter: venkata yerubandi
>             Fix For: 0.8
>
>         Attachments: py_generator.patch
>
>
> Scenario 
> Client                         
> ------
> Python client 
> Server 
> ------
> Java Service {created without this patch 
> https://issues.apache.org/jira/secure/attachment/12521190/primitive_result_fix.patch}
> When testing a python thrift client accessing a thrift service generated with 
> unpatched thrift 
> - a exception generated on the server is returned all the way to the thrift 
> python wrapper but not to the client 
> - this is due to the fact that we have the following result :
>     success=0
>     ise=InternalServiceException()
> and python wrapper checks if result.success is not None , where as it should 
> have been checking for the presence of 
> exceptions first
> current code snippet generated 
> -----------------------------------------
>     if result.success is not None:
>       return result.success
>     if result.ise is not None:
>       raise result.ise
>     if result.fee is not None:
>       raise result.fee
> the patch submitted here fixes this so that the code snippet generated is
>     if result.ise is not None:
>       raise result.ise
>     if result.fee is not None:
>       raise result.fee
>     if result.success is not None:
>       return result.success
> which should have been the order to start with. 

--
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