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

Jens Geyer updated THRIFT-3230:
-------------------------------
    Description: 
for example:

{code:title=error.thrift}
namespace py error
exception KolodaException {
    string message
}
{code}

{code:title=biz.thrift}
namespace py biz
include "error.thrift"
typedef error.KolodaException KolodaException
BizService {
    void doSomeBiz() throws (1: KolodaException ex)
}
{code}

compiled code
{code}
    try:
      result.success = self._handler.doSomeBiz()
    except KolodaException as ex:
      result.ex = ex
{code}

`except KolodaException as ex:` should be `except error.KolodaException as ex:`

  was:
for example:

error.thrift
```
namespace py error
exception KolodaException {
    string message
}
```

biz.thrift
```
namespace py biz
include "error.thrift"
typedef error.KolodaException KolodaException
BizService {
    void doSomeBiz() throws (1: KolodaException ex)
}
```

compiled code

    try:
      result.success = self._handler.doSomeBiz()
    except KolodaException as ex:
      result.ex = ex

`except KolodaException as ex:` should be `except error.KolodaException as ex:`


> Python compiler generates wrong code if there is function throwing a typedef 
> of exception with another namespace
> ----------------------------------------------------------------------------------------------------------------
>
>                 Key: THRIFT-3230
>                 URL: https://issues.apache.org/jira/browse/THRIFT-3230
>             Project: Thrift
>          Issue Type: Bug
>          Components: Python - Compiler
>    Affects Versions: 0.9.2
>            Reporter: 李飛
>            Priority: Blocker
>             Fix For: 1.0
>
>
> for example:
> {code:title=error.thrift}
> namespace py error
> exception KolodaException {
>     string message
> }
> {code}
> {code:title=biz.thrift}
> namespace py biz
> include "error.thrift"
> typedef error.KolodaException KolodaException
> BizService {
>     void doSomeBiz() throws (1: KolodaException ex)
> }
> {code}
> compiled code
> {code}
>     try:
>       result.success = self._handler.doSomeBiz()
>     except KolodaException as ex:
>       result.ex = ex
> {code}
> `except KolodaException as ex:` should be `except error.KolodaException as 
> ex:`



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to