Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-3230

Python compiler generates wrong code if there is function throwing a typedef of exception with another namespace

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 0.9.2
    • Fix Version/s: 0.9.3
    • Component/s: Python - Compiler
    • Labels:
      None

      Description

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

        Attachments

          Activity

            People

            • Assignee:
              lifei.vip 李飛
              Reporter:
              lifei.vip 李飛
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: