Exemple #1
0
 async def handle_message2(self, sender: str, data: AnyStr):
     logger.debug("Handling msg from %s", sender)
     data_logger.debug(data)
     done, pending = await asyncio.wait([self.manage(sender, data)])
     t = list(done)[0]
     exc = t.exception()
     if exc:
         logger.error(log_exception(exc))
         if self.supports_responses:
             return [
                 self.protocol.invalid_request_response(sender, data, exc)
             ]
     return t.result()
Exemple #2
0
def log_exceptions(loop, context):
    logger.error(context['message'])
    logger.error(log_exception(context['exception']))
    raise context['exception']
Exemple #3
0
 def log_task_exceptions(task):
     exc = task.exception()
     if exc:
         logger.error(log_exception(exc))
Exemple #4
0
 async def do_simple_actions(self, msg):
     for action in self.actions:
         try:
             await action.do_one(msg)
         except Exception as exc:
             logger.error(log_exception(exc))
Exemple #5
0
 def manage_error(exc):
     if exc:
         logger.error(log_exception(exc))