当前位置: 首页>>代码示例>>Python>>正文


Python TTransport.TTransportException方法代码示例

本文整理汇总了Python中thrift.transport.TTransport.TTransportException方法的典型用法代码示例。如果您正苦于以下问题:Python TTransport.TTransportException方法的具体用法?Python TTransport.TTransportException怎么用?Python TTransport.TTransportException使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在thrift.transport.TTransport的用法示例。


在下文中一共展示了TTransport.TTransportException方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: connectionMade

# 需要导入模块: from thrift.transport import TTransport [as 别名]
# 或者: from thrift.transport.TTransport import TTransportException [as 别名]
def connectionMade(self):
        self._sendSASLMessage(self.START, self.sasl.mechanism)
        initial_message = yield deferToThread(self.sasl.process)
        self._sendSASLMessage(self.OK, initial_message)

        while True:
            status, challenge = yield self._receiveSASLMessage()
            if status == self.OK:
                response = yield deferToThread(self.sasl.process, challenge)
                self._sendSASLMessage(self.OK, response)
            elif status == self.COMPLETE:
                if not self.sasl.complete:
                    msg = "The server erroneously indicated that SASL " \
                          "negotiation was complete"
                    raise TTransport.TTransportException(msg, message=msg)
                else:
                    break
            else:
                msg = "Bad SASL negotiation status: %d (%s)" % (status, challenge)
                raise TTransport.TTransportException(msg, message=msg)

        self._sasl_negotiation_deferred = None
        ThriftClientProtocol.connectionMade(self) 
开发者ID:XiaoMi,项目名称:galaxy-sdk-python,代码行数:25,代码来源:TTwisted.py

示例2: serve

# 需要导入模块: from thrift.transport import TTransport [as 别名]
# 或者: from thrift.transport.TTransport import TTransportException [as 别名]
def serve(self):
    self.serverTransport.listen()
    while True:
      client = self.serverTransport.accept()
      if not client:
        continue
      itrans = self.inputTransportFactory.getTransport(client)
      otrans = self.outputTransportFactory.getTransport(client)
      iprot = self.inputProtocolFactory.getProtocol(itrans)
      oprot = self.outputProtocolFactory.getProtocol(otrans)
      try:
        while True:
          self.processor.process(iprot, oprot)
      except TTransport.TTransportException, tx:
        pass
      except Exception, x:
        logger.exception(x) 
开发者ID:XiaoMi,项目名称:galaxy-sdk-python,代码行数:19,代码来源:TServer.py

示例3: process_approveChannelAndIssueChannelToken

# 需要导入模块: from thrift.transport import TTransport [as 别名]
# 或者: from thrift.transport.TTransport import TTransportException [as 别名]
def process_approveChannelAndIssueChannelToken(self, seqid, iprot, oprot):
    args = approveChannelAndIssueChannelToken_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = approveChannelAndIssueChannelToken_result()
    try:
      result.success = self._handler.approveChannelAndIssueChannelToken(args.channelId)
      msg_type = TMessageType.REPLY
    except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
      raise
    except ChannelException as e:
      msg_type = TMessageType.REPLY
      result.e = e
    except Exception as ex:
      msg_type = TMessageType.EXCEPTION
      logging.exception(ex)
      result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
    oprot.writeMessageBegin("approveChannelAndIssueChannelToken", msg_type, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush() 
开发者ID:merkremont,项目名称:LineVodka,代码行数:23,代码来源:ChannelService.py

示例4: process_approveChannelAndIssueRequestToken

# 需要导入模块: from thrift.transport import TTransport [as 别名]
# 或者: from thrift.transport.TTransport import TTransportException [as 别名]
def process_approveChannelAndIssueRequestToken(self, seqid, iprot, oprot):
    args = approveChannelAndIssueRequestToken_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = approveChannelAndIssueRequestToken_result()
    try:
      result.success = self._handler.approveChannelAndIssueRequestToken(args.channelId, args.otpId)
      msg_type = TMessageType.REPLY
    except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
      raise
    except ChannelException as e:
      msg_type = TMessageType.REPLY
      result.e = e
    except Exception as ex:
      msg_type = TMessageType.EXCEPTION
      logging.exception(ex)
      result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
    oprot.writeMessageBegin("approveChannelAndIssueRequestToken", msg_type, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush() 
开发者ID:merkremont,项目名称:LineVodka,代码行数:23,代码来源:ChannelService.py

示例5: process_fetchNotificationItems

# 需要导入模块: from thrift.transport import TTransport [as 别名]
# 或者: from thrift.transport.TTransport import TTransportException [as 别名]
def process_fetchNotificationItems(self, seqid, iprot, oprot):
    args = fetchNotificationItems_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = fetchNotificationItems_result()
    try:
      result.success = self._handler.fetchNotificationItems(args.localRev)
      msg_type = TMessageType.REPLY
    except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
      raise
    except ChannelException as e:
      msg_type = TMessageType.REPLY
      result.e = e
    except Exception as ex:
      msg_type = TMessageType.EXCEPTION
      logging.exception(ex)
      result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
    oprot.writeMessageBegin("fetchNotificationItems", msg_type, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush() 
开发者ID:merkremont,项目名称:LineVodka,代码行数:23,代码来源:ChannelService.py

示例6: process_getApprovedChannels

# 需要导入模块: from thrift.transport import TTransport [as 别名]
# 或者: from thrift.transport.TTransport import TTransportException [as 别名]
def process_getApprovedChannels(self, seqid, iprot, oprot):
    args = getApprovedChannels_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = getApprovedChannels_result()
    try:
      result.success = self._handler.getApprovedChannels(args.lastSynced, args.locale)
      msg_type = TMessageType.REPLY
    except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
      raise
    except ChannelException as e:
      msg_type = TMessageType.REPLY
      result.e = e
    except Exception as ex:
      msg_type = TMessageType.EXCEPTION
      logging.exception(ex)
      result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
    oprot.writeMessageBegin("getApprovedChannels", msg_type, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush() 
开发者ID:merkremont,项目名称:LineVodka,代码行数:23,代码来源:ChannelService.py

示例7: process_getChannelInfo

# 需要导入模块: from thrift.transport import TTransport [as 别名]
# 或者: from thrift.transport.TTransport import TTransportException [as 别名]
def process_getChannelInfo(self, seqid, iprot, oprot):
    args = getChannelInfo_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = getChannelInfo_result()
    try:
      result.success = self._handler.getChannelInfo(args.channelId, args.locale)
      msg_type = TMessageType.REPLY
    except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
      raise
    except ChannelException as e:
      msg_type = TMessageType.REPLY
      result.e = e
    except Exception as ex:
      msg_type = TMessageType.EXCEPTION
      logging.exception(ex)
      result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
    oprot.writeMessageBegin("getChannelInfo", msg_type, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush() 
开发者ID:merkremont,项目名称:LineVodka,代码行数:23,代码来源:ChannelService.py

示例8: process_getChannelNotificationSettings

# 需要导入模块: from thrift.transport import TTransport [as 别名]
# 或者: from thrift.transport.TTransport import TTransportException [as 别名]
def process_getChannelNotificationSettings(self, seqid, iprot, oprot):
    args = getChannelNotificationSettings_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = getChannelNotificationSettings_result()
    try:
      result.success = self._handler.getChannelNotificationSettings(args.locale)
      msg_type = TMessageType.REPLY
    except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
      raise
    except ChannelException as e:
      msg_type = TMessageType.REPLY
      result.e = e
    except Exception as ex:
      msg_type = TMessageType.EXCEPTION
      logging.exception(ex)
      result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
    oprot.writeMessageBegin("getChannelNotificationSettings", msg_type, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush() 
开发者ID:merkremont,项目名称:LineVodka,代码行数:23,代码来源:ChannelService.py

示例9: process_getChannels

# 需要导入模块: from thrift.transport import TTransport [as 别名]
# 或者: from thrift.transport.TTransport import TTransportException [as 别名]
def process_getChannels(self, seqid, iprot, oprot):
    args = getChannels_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = getChannels_result()
    try:
      result.success = self._handler.getChannels(args.lastSynced, args.locale)
      msg_type = TMessageType.REPLY
    except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
      raise
    except ChannelException as e:
      msg_type = TMessageType.REPLY
      result.e = e
    except Exception as ex:
      msg_type = TMessageType.EXCEPTION
      logging.exception(ex)
      result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
    oprot.writeMessageBegin("getChannels", msg_type, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush() 
开发者ID:merkremont,项目名称:LineVodka,代码行数:23,代码来源:ChannelService.py

示例10: process_getDomains

# 需要导入模块: from thrift.transport import TTransport [as 别名]
# 或者: from thrift.transport.TTransport import TTransportException [as 别名]
def process_getDomains(self, seqid, iprot, oprot):
    args = getDomains_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = getDomains_result()
    try:
      result.success = self._handler.getDomains(args.lastSynced)
      msg_type = TMessageType.REPLY
    except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
      raise
    except ChannelException as e:
      msg_type = TMessageType.REPLY
      result.e = e
    except Exception as ex:
      msg_type = TMessageType.EXCEPTION
      logging.exception(ex)
      result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
    oprot.writeMessageBegin("getDomains", msg_type, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush() 
开发者ID:merkremont,项目名称:LineVodka,代码行数:23,代码来源:ChannelService.py

示例11: process_getFriendChannelMatrices

# 需要导入模块: from thrift.transport import TTransport [as 别名]
# 或者: from thrift.transport.TTransport import TTransportException [as 别名]
def process_getFriendChannelMatrices(self, seqid, iprot, oprot):
    args = getFriendChannelMatrices_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = getFriendChannelMatrices_result()
    try:
      result.success = self._handler.getFriendChannelMatrices(args.channelIds)
      msg_type = TMessageType.REPLY
    except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
      raise
    except ChannelException as e:
      msg_type = TMessageType.REPLY
      result.e = e
    except Exception as ex:
      msg_type = TMessageType.EXCEPTION
      logging.exception(ex)
      result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
    oprot.writeMessageBegin("getFriendChannelMatrices", msg_type, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush() 
开发者ID:merkremont,项目名称:LineVodka,代码行数:23,代码来源:ChannelService.py

示例12: process_getNotificationBadgeCount

# 需要导入模块: from thrift.transport import TTransport [as 别名]
# 或者: from thrift.transport.TTransport import TTransportException [as 别名]
def process_getNotificationBadgeCount(self, seqid, iprot, oprot):
    args = getNotificationBadgeCount_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = getNotificationBadgeCount_result()
    try:
      result.success = self._handler.getNotificationBadgeCount(args.localRev)
      msg_type = TMessageType.REPLY
    except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
      raise
    except ChannelException as e:
      msg_type = TMessageType.REPLY
      result.e = e
    except Exception as ex:
      msg_type = TMessageType.EXCEPTION
      logging.exception(ex)
      result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
    oprot.writeMessageBegin("getNotificationBadgeCount", msg_type, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush() 
开发者ID:merkremont,项目名称:LineVodka,代码行数:23,代码来源:ChannelService.py

示例13: process_issueRequestToken

# 需要导入模块: from thrift.transport import TTransport [as 别名]
# 或者: from thrift.transport.TTransport import TTransportException [as 别名]
def process_issueRequestToken(self, seqid, iprot, oprot):
    args = issueRequestToken_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = issueRequestToken_result()
    try:
      result.success = self._handler.issueRequestToken(args.channelId, args.otpId)
      msg_type = TMessageType.REPLY
    except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
      raise
    except ChannelException as e:
      msg_type = TMessageType.REPLY
      result.e = e
    except Exception as ex:
      msg_type = TMessageType.EXCEPTION
      logging.exception(ex)
      result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
    oprot.writeMessageBegin("issueRequestToken", msg_type, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush() 
开发者ID:merkremont,项目名称:LineVodka,代码行数:23,代码来源:ChannelService.py

示例14: process_issueRequestTokenWithAuthScheme

# 需要导入模块: from thrift.transport import TTransport [as 别名]
# 或者: from thrift.transport.TTransport import TTransportException [as 别名]
def process_issueRequestTokenWithAuthScheme(self, seqid, iprot, oprot):
    args = issueRequestTokenWithAuthScheme_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = issueRequestTokenWithAuthScheme_result()
    try:
      result.success = self._handler.issueRequestTokenWithAuthScheme(args.channelId, args.otpId, args.authScheme, args.returnUrl)
      msg_type = TMessageType.REPLY
    except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
      raise
    except ChannelException as e:
      msg_type = TMessageType.REPLY
      result.e = e
    except Exception as ex:
      msg_type = TMessageType.EXCEPTION
      logging.exception(ex)
      result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
    oprot.writeMessageBegin("issueRequestTokenWithAuthScheme", msg_type, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush() 
开发者ID:merkremont,项目名称:LineVodka,代码行数:23,代码来源:ChannelService.py

示例15: process_reserveCoinUse

# 需要导入模块: from thrift.transport import TTransport [as 别名]
# 或者: from thrift.transport.TTransport import TTransportException [as 别名]
def process_reserveCoinUse(self, seqid, iprot, oprot):
    args = reserveCoinUse_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = reserveCoinUse_result()
    try:
      result.success = self._handler.reserveCoinUse(args.request, args.locale)
      msg_type = TMessageType.REPLY
    except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
      raise
    except ChannelException as e:
      msg_type = TMessageType.REPLY
      result.e = e
    except Exception as ex:
      msg_type = TMessageType.EXCEPTION
      logging.exception(ex)
      result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
    oprot.writeMessageBegin("reserveCoinUse", msg_type, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush() 
开发者ID:merkremont,项目名称:LineVodka,代码行数:23,代码来源:ChannelService.py


注:本文中的thrift.transport.TTransport.TTransportException方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。