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

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 0.9.2
    • 0.9.3
    • Python - Compiler
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: