Python thrift.Thrift.TApplicationException.INTERNAL_ERROR Examples

The following are 30 code examples of thrift.Thrift.TApplicationException.INTERNAL_ERROR(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module thrift.Thrift.TApplicationException , or try the search function .
Example #1
Source File: ChannelService.py    From simpleSB with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
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() 
Example #2
Source File: AccountSupervisorService.py    From simpleSB with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def process_requestVirtualAccountPasswordChange(self, seqid, iprot, oprot):
        args = requestVirtualAccountPasswordChange_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = requestVirtualAccountPasswordChange_result()
        try:
            self._handler.requestVirtualAccountPasswordChange(args.virtualMid, args.encryptedVirtualUserId, args.encryptedOldPassword, args.encryptedNewPassword)
            msg_type = TMessageType.REPLY
        except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
            raise
        except TalkException 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("requestVirtualAccountPasswordChange", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush() 
Example #3
Source File: SquareService.py    From simpleSB with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def process_sendMessage(self, seqid, iprot, oprot):
        args = sendMessage_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = sendMessage_result()
        try:
            result.success = self._handler.sendMessage(args.reqSeq, args.squareChatMid, args.squareMessage)
            msg_type = TMessageType.REPLY
        except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
            raise
        except SquareException 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("sendMessage", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush() 
Example #4
Source File: AccountSupervisorService.py    From simpleSB with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def process_unregisterVirtualAccount(self, seqid, iprot, oprot):
        args = unregisterVirtualAccount_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = unregisterVirtualAccount_result()
        try:
            self._handler.unregisterVirtualAccount(args.virtualMid)
            msg_type = TMessageType.REPLY
        except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
            raise
        except TalkException 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("unregisterVirtualAccount", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

# HELPER FUNCTIONS AND STRUCTURES 
Example #5
Source File: MessageService.py    From simpleSB with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def process_getLastReadMessageIds(self, seqid, iprot, oprot):
        args = getLastReadMessageIds_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = getLastReadMessageIds_result()
        try:
            result.success = self._handler.getLastReadMessageIds(args.chatId)
            msg_type = TMessageType.REPLY
        except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
            raise
        except TalkException 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("getLastReadMessageIds", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush() 
Example #6
Source File: AccountSupervisorService.py    From simpleSB with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def process_requestVirtualAccountPasswordSet(self, seqid, iprot, oprot):
        args = requestVirtualAccountPasswordSet_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = requestVirtualAccountPasswordSet_result()
        try:
            self._handler.requestVirtualAccountPasswordSet(args.virtualMid, args.encryptedVirtualUserId, args.encryptedNewPassword)
            msg_type = TMessageType.REPLY
        except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
            raise
        except TalkException 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("requestVirtualAccountPasswordSet", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush() 
Example #7
Source File: AccountSupervisorService.py    From simpleSB with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def process_notifyEmailConfirmationResult(self, seqid, iprot, oprot):
        args = notifyEmailConfirmationResult_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = notifyEmailConfirmationResult_result()
        try:
            self._handler.notifyEmailConfirmationResult(args.parameterMap)
            msg_type = TMessageType.REPLY
        except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
            raise
        except TalkException 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("notifyEmailConfirmationResult", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush() 
Example #8
Source File: UniversalNotificationService.py    From simpleSB with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def process_notify(self, seqid, iprot, oprot):
        args = notify_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = notify_result()
        try:
            self._handler.notify(args.event)
            msg_type = TMessageType.REPLY
        except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
            raise
        except UniversalNotificationServiceException 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("notify", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

# HELPER FUNCTIONS AND STRUCTURES 
Example #9
Source File: SquareService.py    From simpleSB with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def process_getJoinedSquares(self, seqid, iprot, oprot):
        args = getJoinedSquares_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = getJoinedSquares_result()
        try:
            result.success = self._handler.getJoinedSquares(args.continuationToken, args.limit)
            msg_type = TMessageType.REPLY
        except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
            raise
        except SquareException 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("getJoinedSquares", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush()

# HELPER FUNCTIONS AND STRUCTURES 
Example #10
Source File: SquareService.py    From simpleSB with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def process_getSquare(self, seqid, iprot, oprot):
        args = getSquare_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = getSquare_result()
        try:
            result.success = self._handler.getSquare(args.mid)
            msg_type = TMessageType.REPLY
        except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
            raise
        except SquareException 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("getSquare", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush() 
Example #11
Source File: AccountSupervisorService.py    From simpleSB with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def process_registerVirtualAccount(self, seqid, iprot, oprot):
        args = registerVirtualAccount_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = registerVirtualAccount_result()
        try:
            result.success = self._handler.registerVirtualAccount(args.locale, args.encryptedVirtualUserId, args.encryptedPassword)
            msg_type = TMessageType.REPLY
        except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
            raise
        except TalkException 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("registerVirtualAccount", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush() 
Example #12
Source File: CallService.py    From simpleSB with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def process_acquireCallRoute(self, seqid, iprot, oprot):
        args = acquireCallRoute_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = acquireCallRoute_result()
        try:
            result.success = self._handler.acquireCallRoute(args.to)
            msg_type = TMessageType.REPLY
        except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
            raise
        except TalkException 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("acquireCallRoute", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush() 
Example #13
Source File: ChannelService.py    From simpleSB with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def process_syncChannelData(self, seqid, iprot, oprot):
        args = syncChannelData_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = syncChannelData_result()
        try:
            result.success = self._handler.syncChannelData(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("syncChannelData", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush() 
Example #14
Source File: ChannelService.py    From simpleSB with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def process_revokeChannel(self, seqid, iprot, oprot):
        args = revokeChannel_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = revokeChannel_result()
        try:
            self._handler.revokeChannel(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("revokeChannel", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush() 
Example #15
Source File: ChannelService.py    From simpleSB with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
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() 
Example #16
Source File: CallService.py    From simpleSB with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def process_acquireGroupCallRoute(self, seqid, iprot, oprot):
        args = acquireGroupCallRoute_args()
        args.read(iprot)
        iprot.readMessageEnd()
        result = acquireGroupCallRoute_result()
        try:
            result.success = self._handler.acquireGroupCallRoute(args.groupId, args.mediaType)
            msg_type = TMessageType.REPLY
        except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
            raise
        except TalkException 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("acquireGroupCallRoute", msg_type, seqid)
        result.write(oprot)
        oprot.writeMessageEnd()
        oprot.trans.flush() 
Example #17
Source File: ChannelService.py    From simpleSB with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
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() 
Example #18
Source File: ChannelService.py    From simpleSB with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
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() 
Example #19
Source File: ChannelService.py    From simpleSB with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
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() 
Example #20
Source File: ChannelService.py    From simpleSB with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
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() 
Example #21
Source File: ChannelService.py    From simpleSB with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
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() 
Example #22
Source File: ChannelService.py    From simpleSB with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
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() 
Example #23
Source File: ChannelService.py    From simpleSB with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
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() 
Example #24
Source File: ChannelService.py    From simpleSB with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
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() 
Example #25
Source File: ChannelService.py    From simpleSB with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
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() 
Example #26
Source File: ChannelService.py    From simpleSB with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
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() 
Example #27
Source File: ChannelService.py    From simpleSB with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
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() 
Example #28
Source File: MessageService.py    From LineVodka with GNU General Public License v3.0 6 votes vote down vote up
def process_multiGetLastReadMessageIds(self, seqid, iprot, oprot):
    args = multiGetLastReadMessageIds_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = multiGetLastReadMessageIds_result()
    try:
      result.success = self._handler.multiGetLastReadMessageIds(args.chatIds)
      msg_type = TMessageType.REPLY
    except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
      raise
    except TalkException 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("multiGetLastReadMessageIds", msg_type, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()


# HELPER FUNCTIONS AND STRUCTURES 
Example #29
Source File: MessageService.py    From LineVodka with GNU General Public License v3.0 6 votes vote down vote up
def process_getLastReadMessageIds(self, seqid, iprot, oprot):
    args = getLastReadMessageIds_args()
    args.read(iprot)
    iprot.readMessageEnd()
    result = getLastReadMessageIds_result()
    try:
      result.success = self._handler.getLastReadMessageIds(args.chatId)
      msg_type = TMessageType.REPLY
    except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):
      raise
    except TalkException 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("getLastReadMessageIds", msg_type, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush() 
Example #30
Source File: MessageService.py    From LineVodka with GNU General Public License v3.0 6 votes vote down vote up
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, KeyboardInterrupt, SystemExit):
      raise
    except TalkException 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("fetchMessageOperations", msg_type, seqid)
    result.write(oprot)
    oprot.writeMessageEnd()
    oprot.trans.flush()