XMLWordPrintableJSON

    Details

      Description

      As ThriftTest.thrift has defined TestException has 3 scenarios.

      if arg == "Xception" throw Xception with errorCode = 1001 and message = arg
      else if arg == "TException" throw TException
      else do not throw anything

      But when testException("TException") is called, python server is failing saying

      testException(TException)
      ERROR:root:This is a TException
      Traceback (most recent call last):
      File "py/../../lib/py/build/lib.linux-x86_64-2.7/thrift/server/TServer.py", line 86, in serve
      self.processor.process(iprot, oprot)
      File "py/gen-py/ThriftTest/ThriftTest.py", line 1006, in process
      self._processMap[name](self, seqid, iprot, oprot)
      File "py/gen-py/ThriftTest/ThriftTest.py", line 1202, in process_testException
      self._handler.testException(args.arg)
      File "py/TestServer.py", line 115, in testException
      raise TException(message='This is a TException')
      TException: This is a TException

      It looks like this causes since auto generated gen-py/ThriftTest/ThriftTest.py doesn't catch TException.

      def process_testException(self, seqid, iprot, oprot):
      args = testException_args()
      args.read(iprot)
      iprot.readMessageEnd()
      result = testException_result()
      try:
      self._handler.testException(args.arg)
      except Xception, err1:
      result.err1 = err1
      oprot.writeMessageBegin("testException", TMessageType.REPLY, seqid)
      result.write(oprot)
      oprot.writeMessageEnd()
      oprot.trans.flush()

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              cdwijayarathna Chamila Dilshan Wijayarathna
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: