本文整理汇总了Python中thrift.Thrift.TApplicationException类的典型用法代码示例。如果您正苦于以下问题:Python TApplicationException类的具体用法?Python TApplicationException怎么用?Python TApplicationException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TApplicationException类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: process_annotate
def process_annotate(self, seqid, iprot, oprot):
args = annotate_args()
args.read(iprot)
iprot.readMessageEnd()
result = annotate_result()
try:
result.success = self._handler.annotate(args.original)
msg_type = TMessageType.REPLY
except TTransport.TTransportException:
raise
except concrete.exceptions.ttypes.ConcreteThriftException as ex:
msg_type = TMessageType.REPLY
result.ex = ex
except TApplicationException as ex:
logging.exception('TApplication exception in handler')
msg_type = TMessageType.EXCEPTION
result = ex
except Exception:
logging.exception('Unexpected exception in handler')
msg_type = TMessageType.EXCEPTION
result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
oprot.writeMessageBegin("annotate", msg_type, seqid)
result.write(oprot)
oprot.writeMessageEnd()
oprot.trans.flush()
开发者ID:hltcoe,项目名称:concrete-python,代码行数:25,代码来源:AnnotateCommunicationService.py
示例2: recv_Log
def recv_Log(self, iprot, mtype, rseqid):
"""
Called when the result of the log request was received.
"""
if mtype == TMessageType.EXCEPTION:
result = TApplicationException()
else:
result = scribe.Log_result()
result.read(iprot)
iprot.readMessageEnd()
try:
d = self._reqs.pop(rseqid)
except KeyError:
log.err(result, "Unexpected log result")
if isinstance(result, Exception):
d.errback(result)
elif result.success is not None:
d.callback(result.success)
else:
d.errback(TApplicationException(
TApplicationException.MISSING_RESULT,
'Log failed: unknown result'))
开发者ID:mailgun,项目名称:udplog,代码行数:25,代码来源:scribe.py
示例3: _handle_request
def _handle_request(self, listener_name, sock, addr):
client = TFileObjectTransport(sock.makefile())
itrans = self.tfactory.getTransport(client)
otrans = self.tfactory.getTransport(client)
iprot = self.pfactory.getProtocol(itrans)
oprot = self.pfactory.getProtocol(otrans)
try:
while True:
(name, type, seqid) = iprot.readMessageBegin()
request_start = time.time()
try:
timeout_con = Timeout(self.cfg.timeout, Timeout)
timeout_con.start()
if name not in self.wsgi._processMap:
iprot.skip(TType.STRUCT)
iprot.readMessageEnd()
x = TApplicationException(
TApplicationException.UNKNOWN_METHOD, "Unknown function %s" % (name))
oprot.writeMessageBegin(
name, TMessageType.EXCEPTION, seqid)
x.write(oprot)
oprot.writeMessageEnd()
oprot.trans.flush()
raise ThriftFuncNotFound
else:
self.wsgi._processMap[name](self.wsgi, seqid, iprot, oprot)
except ThriftFuncNotFound, ex:
self.log.error("Unknown function %s" % (name))
self.log.access(
addr, name, "FUNC_NOT_FOUND", time.time() - request_start)
except Timeout, ex:
self.log.error("A greenlet process timeout.")
self.log.access(
addr, name, "TIMEOUT", time.time() - request_start)
开发者ID:wodfan,项目名称:gunicorn_thrift,代码行数:34,代码来源:gthriftgevent.py
示例4: process_create
def process_create(self, seqid, iprot, oprot):
args = create_args()
args.read(iprot)
iprot.readMessageEnd()
result = create_result()
try:
result.success = self._handler.create(args.request)
msg_type = TMessageType.REPLY
except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
raise
except ServiceUnavailable as service_error:
msg_type = TMessageType.REPLY
result.service_error = service_error
except ImageNotSupported as error:
msg_type = TMessageType.REPLY
result.error = error
except UploadImageError as image_error:
msg_type = TMessageType.REPLY
result.image_error = image_error
except Exception as ex:
msg_type = TMessageType.EXCEPTION
logging.exception(ex)
result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
oprot.writeMessageBegin("create", msg_type, seqid)
result.write(oprot)
oprot.writeMessageEnd()
oprot.trans.flush()
开发者ID:SingWang93,项目名称:web_develop,代码行数:27,代码来源:PasteFileService.py
示例5: process_postSnsInvitationMessage
def process_postSnsInvitationMessage(self, seqid, iprot, oprot):
args = postSnsInvitationMessage_args()
args.read(iprot)
iprot.readMessageEnd()
result = postSnsInvitationMessage_result()
try:
self._handler.postSnsInvitationMessage(args.snsIdType, args.snsAccessToken, args.toSnsUserId)
msg_type = TMessageType.REPLY
except TTransport.TTransportException:
raise
except TalkException as e:
msg_type = TMessageType.REPLY
result.e = e
except TApplicationException as ex:
logging.exception('TApplication exception in handler')
msg_type = TMessageType.EXCEPTION
result = ex
except Exception:
logging.exception('Unexpected exception in handler')
msg_type = TMessageType.EXCEPTION
result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
oprot.writeMessageBegin("postSnsInvitationMessage", msg_type, seqid)
result.write(oprot)
oprot.writeMessageEnd()
oprot.trans.flush()
开发者ID:AlmiRajoBasa,项目名称:PlayerTest,代码行数:25,代码来源:SnsAdaptorService.py
示例6: process_similar
def process_similar(self, seqid, iprot, oprot):
args = similar_args()
args.read(iprot)
iprot.readMessageEnd()
result = similar_result()
try:
result.success = self._handler.similar(args.query, args.n, args.sorting)
msg_type = TMessageType.REPLY
except TTransport.TTransportException:
raise
except TSearchException as error:
msg_type = TMessageType.REPLY
result.error = error
except TApplicationException as ex:
logging.exception('TApplication exception in handler')
msg_type = TMessageType.EXCEPTION
result = ex
except Exception:
logging.exception('Unexpected exception in handler')
msg_type = TMessageType.EXCEPTION
result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
oprot.writeMessageBegin("similar", msg_type, seqid)
result.write(oprot)
oprot.writeMessageEnd()
oprot.trans.flush()
开发者ID:samtingleff,项目名称:yassg,代码行数:25,代码来源:TSearchService.py
示例7: process_fetchMessageOperations
def process_fetchMessageOperations(self, seqid, iprot, oprot):
args = fetchMessageOperations_args()
args.read(iprot)
iprot.readMessageEnd()
result = fetchMessageOperations_result()
try:
result.success = self._handler.fetchMessageOperations(args.localRevision, args.lastOpTimestamp, args.count)
msg_type = TMessageType.REPLY
except TTransport.TTransportException:
raise
except TalkException as e:
msg_type = TMessageType.REPLY
result.e = e
except TApplicationException as ex:
logging.exception('TApplication exception in handler')
msg_type = TMessageType.EXCEPTION
result = ex
except Exception:
logging.exception('Unexpected exception in handler')
msg_type = TMessageType.EXCEPTION
result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
oprot.writeMessageBegin("fetchMessageOperations", msg_type, seqid)
result.write(oprot)
oprot.writeMessageEnd()
oprot.trans.flush()
开发者ID:AlmiRajoBasa,项目名称:PlayerTest,代码行数:25,代码来源:MessageService.py
示例8: write_results_after_future
def write_results_after_future(
result, event_handler, handler_ctx, seqid, oprot, fn_name,
known_exceptions, future,
):
"""Result/exception handler for asyncio futures."""
try:
try:
result.success = future.result()
reply_type = TMessageType.REPLY
except TException as e:
for exc_name, exc_type in known_exceptions.items():
setattr(result, exc_name, e)
reply_type = TMessageType.REPLY
event_handler.handlerException(handler_ctx, fn_name, e)
break
else:
raise
except Exception as e:
result = TApplicationException(message=str(e))
reply_type = TMessageType.EXCEPTION
event_handler.handlerError(handler_ctx, fn_name, e)
event_handler.preWrite(handler_ctx, fn_name, result)
oprot.writeMessageBegin(fn_name, reply_type, seqid)
result.write(oprot)
oprot.writeMessageEnd()
oprot.trans.flush()
event_handler.postWrite(handler_ctx, fn_name, result)
开发者ID:ConfusedReality,项目名称:pkg_serialization_fbthrift,代码行数:28,代码来源:Decorators.py
示例9: process_ping
def process_ping(self, seqid, iprot, oprot):
args = ping_args()
args.read(iprot)
iprot.readMessageEnd()
result = ping_result()
try:
result.success = self._handler.ping()
msg_type = TMessageType.REPLY
except TTransport.TTransportException:
raise
except AboutToShutDownException as shutdown_exception:
msg_type = TMessageType.REPLY
result.shutdown_exception = shutdown_exception
except TApplicationException as ex:
logging.exception('TApplication exception in handler')
msg_type = TMessageType.EXCEPTION
result = ex
except Exception:
logging.exception('Unexpected exception in handler')
msg_type = TMessageType.EXCEPTION
result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
oprot.writeMessageBegin("ping", msg_type, seqid)
result.write(oprot)
oprot.writeMessageEnd()
oprot.trans.flush()
开发者ID:eleme,项目名称:gunicorn_thrift,代码行数:25,代码来源:PingService.py
示例10: process_retrieveRequestToken
def process_retrieveRequestToken(self, seqid, iprot, oprot):
args = retrieveRequestToken_args()
args.read(iprot)
iprot.readMessageEnd()
result = retrieveRequestToken_result()
try:
result.success = self._handler.retrieveRequestToken(args.carrier)
msg_type = TMessageType.REPLY
except TTransport.TTransportException:
raise
except TalkException as e:
msg_type = TMessageType.REPLY
result.e = e
except TApplicationException as ex:
logging.exception('TApplication exception in handler')
msg_type = TMessageType.EXCEPTION
result = ex
except Exception:
logging.exception('Unexpected exception in handler')
msg_type = TMessageType.EXCEPTION
result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
oprot.writeMessageBegin("retrieveRequestToken", msg_type, seqid)
result.write(oprot)
oprot.writeMessageEnd()
oprot.trans.flush()
开发者ID:AlmiRajoBasa,项目名称:PlayerTest,代码行数:25,代码来源:AgeCheckService.py
示例11: process_getLocalAssignmentForStorm
def process_getLocalAssignmentForStorm(self, seqid, iprot, oprot):
args = getLocalAssignmentForStorm_args()
args.read(iprot)
iprot.readMessageEnd()
result = getLocalAssignmentForStorm_result()
try:
result.success = self._handler.getLocalAssignmentForStorm(args.id)
msg_type = TMessageType.REPLY
except TTransport.TTransportException:
raise
except NotAliveException as e:
msg_type = TMessageType.REPLY
result.e = e
except AuthorizationException as aze:
msg_type = TMessageType.REPLY
result.aze = aze
except TApplicationException as ex:
logging.exception('TApplication exception in handler')
msg_type = TMessageType.EXCEPTION
result = ex
except Exception:
logging.exception('Unexpected exception in handler')
msg_type = TMessageType.EXCEPTION
result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
oprot.writeMessageBegin("getLocalAssignmentForStorm", msg_type, seqid)
result.write(oprot)
oprot.writeMessageEnd()
oprot.trans.flush()
开发者ID:hmcl,项目名称:storm-apache,代码行数:28,代码来源:Supervisor.py
示例12: process_sendChatCheckedByWatermark
def process_sendChatCheckedByWatermark(self, seqid, iprot, oprot):
args = sendChatCheckedByWatermark_args()
args.read(iprot)
iprot.readMessageEnd()
result = sendChatCheckedByWatermark_result()
try:
self._handler.sendChatCheckedByWatermark(args.seq, args.mid, args.watermark, args.sessionId)
msg_type = TMessageType.REPLY
except TTransport.TTransportException:
raise
except TalkException as e:
msg_type = TMessageType.REPLY
result.e = e
except TApplicationException as ex:
logging.exception('TApplication exception in handler')
msg_type = TMessageType.EXCEPTION
result = ex
except Exception:
logging.exception('Unexpected exception in handler')
msg_type = TMessageType.EXCEPTION
result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
oprot.writeMessageBegin("sendChatCheckedByWatermark", msg_type, seqid)
result.write(oprot)
oprot.writeMessageEnd()
oprot.trans.flush()
开发者ID:AlmiRajoBasa,项目名称:PlayerTest,代码行数:25,代码来源:BotService.py
示例13: process_notifyLeaveRoom
def process_notifyLeaveRoom(self, seqid, iprot, oprot):
args = notifyLeaveRoom_args()
args.read(iprot)
iprot.readMessageEnd()
result = notifyLeaveRoom_result()
try:
self._handler.notifyLeaveRoom(args.roomMid)
msg_type = TMessageType.REPLY
except TTransport.TTransportException:
raise
except TalkException as e:
msg_type = TMessageType.REPLY
result.e = e
except TApplicationException as ex:
logging.exception('TApplication exception in handler')
msg_type = TMessageType.EXCEPTION
result = ex
except Exception:
logging.exception('Unexpected exception in handler')
msg_type = TMessageType.EXCEPTION
result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
oprot.writeMessageBegin("notifyLeaveRoom", msg_type, seqid)
result.write(oprot)
oprot.writeMessageEnd()
oprot.trans.flush()
开发者ID:AlmiRajoBasa,项目名称:PlayerTest,代码行数:25,代码来源:BotService.py
示例14: process_getBotUseInfo
def process_getBotUseInfo(self, seqid, iprot, oprot):
args = getBotUseInfo_args()
args.read(iprot)
iprot.readMessageEnd()
result = getBotUseInfo_result()
try:
result.success = self._handler.getBotUseInfo(args.botMid)
msg_type = TMessageType.REPLY
except TTransport.TTransportException:
raise
except TalkException as e:
msg_type = TMessageType.REPLY
result.e = e
except TApplicationException as ex:
logging.exception('TApplication exception in handler')
msg_type = TMessageType.EXCEPTION
result = ex
except Exception:
logging.exception('Unexpected exception in handler')
msg_type = TMessageType.EXCEPTION
result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
oprot.writeMessageBegin("getBotUseInfo", msg_type, seqid)
result.write(oprot)
oprot.writeMessageEnd()
oprot.trans.flush()
开发者ID:AlmiRajoBasa,项目名称:PlayerTest,代码行数:25,代码来源:BotService.py
示例15: process_getCapabilities
def process_getCapabilities(self, seqid, iprot, oprot):
args = getCapabilities_args()
args.read(iprot)
iprot.readMessageEnd()
result = getCapabilities_result()
try:
result.success = self._handler.getCapabilities()
msg_type = TMessageType.REPLY
except TTransport.TTransportException:
raise
except concrete.services.ttypes.ServicesException as ex:
msg_type = TMessageType.REPLY
result.ex = ex
except TApplicationException as ex:
logging.exception('TApplication exception in handler')
msg_type = TMessageType.EXCEPTION
result = ex
except Exception:
logging.exception('Unexpected exception in handler')
msg_type = TMessageType.EXCEPTION
result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
oprot.writeMessageBegin("getCapabilities", msg_type, seqid)
result.write(oprot)
oprot.writeMessageEnd()
oprot.trans.flush()
开发者ID:hltcoe,项目名称:concrete-python,代码行数:25,代码来源:SummarizationService.py
示例16: process_sendSupervisorWorkerHeartbeat
def process_sendSupervisorWorkerHeartbeat(self, seqid, iprot, oprot):
args = sendSupervisorWorkerHeartbeat_args()
args.read(iprot)
iprot.readMessageEnd()
result = sendSupervisorWorkerHeartbeat_result()
try:
self._handler.sendSupervisorWorkerHeartbeat(args.heartbeat)
msg_type = TMessageType.REPLY
except TTransport.TTransportException:
raise
except AuthorizationException as aze:
msg_type = TMessageType.REPLY
result.aze = aze
except TApplicationException as ex:
logging.exception('TApplication exception in handler')
msg_type = TMessageType.EXCEPTION
result = ex
except Exception:
logging.exception('Unexpected exception in handler')
msg_type = TMessageType.EXCEPTION
result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
oprot.writeMessageBegin("sendSupervisorWorkerHeartbeat", msg_type, seqid)
result.write(oprot)
oprot.writeMessageEnd()
oprot.trans.flush()
开发者ID:hmcl,项目名称:storm-apache,代码行数:25,代码来源:Supervisor.py
示例17: process_failRequestV2
def process_failRequestV2(self, seqid, iprot, oprot):
args = failRequestV2_args()
args.read(iprot)
iprot.readMessageEnd()
result = failRequestV2_result()
try:
self._handler.failRequestV2(args.id, args.e)
msg_type = TMessageType.REPLY
except TTransport.TTransportException:
raise
except AuthorizationException as aze:
msg_type = TMessageType.REPLY
result.aze = aze
except TApplicationException as ex:
logging.exception('TApplication exception in handler')
msg_type = TMessageType.EXCEPTION
result = ex
except Exception:
logging.exception('Unexpected exception in handler')
msg_type = TMessageType.EXCEPTION
result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
oprot.writeMessageBegin("failRequestV2", msg_type, seqid)
result.write(oprot)
oprot.writeMessageEnd()
oprot.trans.flush()
开发者ID:iskoda,项目名称:incubator-storm,代码行数:25,代码来源:DistributedRPCInvocations.py
示例18: process_checkUserAgeWithDocomo
def process_checkUserAgeWithDocomo(self, seqid, iprot, oprot):
args = checkUserAgeWithDocomo_args()
args.read(iprot)
iprot.readMessageEnd()
result = checkUserAgeWithDocomo_result()
try:
result.success = self._handler.checkUserAgeWithDocomo(args.openIdRedirectUrl, args.standardAge, args.verifier)
msg_type = TMessageType.REPLY
except TTransport.TTransportException:
raise
except TalkException as e:
msg_type = TMessageType.REPLY
result.e = e
except TApplicationException as ex:
logging.exception('TApplication exception in handler')
msg_type = TMessageType.EXCEPTION
result = ex
except Exception:
logging.exception('Unexpected exception in handler')
msg_type = TMessageType.EXCEPTION
result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
oprot.writeMessageBegin("checkUserAgeWithDocomo", msg_type, seqid)
result.write(oprot)
oprot.writeMessageEnd()
oprot.trans.flush()
开发者ID:AlmiRajoBasa,项目名称:PlayerTest,代码行数:25,代码来源:AgeCheckService.py
示例19: process_execute
def process_execute(self, seqid, iprot, oprot):
args = execute_args()
args.read(iprot)
iprot.readMessageEnd()
result = execute_result()
try:
result.success = self._handler.execute(args.functionName, args.funcArgs)
msg_type = TMessageType.REPLY
except TTransport.TTransportException:
raise
except DRPCExecutionException as e:
msg_type = TMessageType.REPLY
result.e = e
except AuthorizationException as aze:
msg_type = TMessageType.REPLY
result.aze = aze
except TApplicationException as ex:
logging.exception('TApplication exception in handler')
msg_type = TMessageType.EXCEPTION
result = ex
except Exception:
logging.exception('Unexpected exception in handler')
msg_type = TMessageType.EXCEPTION
result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
oprot.writeMessageBegin("execute", msg_type, seqid)
result.write(oprot)
oprot.writeMessageEnd()
oprot.trans.flush()
开发者ID:hmcl,项目名称:storm-apache,代码行数:28,代码来源:DistributedRPC.py
示例20: process_getAllServersWithPreferredServer
def process_getAllServersWithPreferredServer(self, seqid, iprot, oprot):
args = getAllServersWithPreferredServer_args()
args.read(iprot)
iprot.readMessageEnd()
result = getAllServersWithPreferredServer_result()
try:
result.success = self._handler.getAllServersWithPreferredServer(args.serverTypes, args.serverGroups, args.failedServers)
msg_type = TMessageType.REPLY
except TTransport.TTransportException:
raise
except SnappyException as error:
msg_type = TMessageType.REPLY
result.error = error
except TApplicationException as ex:
logging.exception('TApplication exception in handler')
msg_type = TMessageType.EXCEPTION
result = ex
except Exception:
logging.exception('Unexpected exception in handler')
msg_type = TMessageType.EXCEPTION
result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error')
oprot.writeMessageBegin("getAllServersWithPreferredServer", msg_type, seqid)
result.write(oprot)
oprot.writeMessageEnd()
oprot.trans.flush()
开发者ID:deatheyes,项目名称:PySnappydata,代码行数:25,代码来源:LocatorService.py
注:本文中的thrift.Thrift.TApplicationException类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论