def message(self, msg): try: if msg['type'] == 'chat': self.chat(msg) elif msg['type'] == 'error': self.error(msg) else: logger.error('Unknown message type: %s' % self.msgToString(msg)) except: logger.exception('Failed to parse message')
def __del__(self): try: self.xmlstream.sendFooter() except: logger.exception('Problem during delete')