Example #1
0
def _exception_handler(loop: asyncio.AbstractEventLoop, context: dict) -> None:
    exception = context.get("exception")
    if isinstance(exception, ssl.SSLError):
        pass  # Handshake failure
    else:
        loop.default_exception_handler(context)
Example #2
0
def handle_loop_exception(loop: asyncio.AbstractEventLoop,
                          context: Dict[str, Any]) -> None:
    if isinstance(context.get('exception'), asyncio.CancelledError):
        return  # Ignore any cancelled errors

    loop.default_exception_handler(context)
Example #3
0
def asyncio_exception_handler(loop: asyncio.AbstractEventLoop,
                              context: Dict[str, Any]) -> None:
    with suppress(KeyError):
        e = context['exception']
        excepthook(type(e), e, e.__traceback__)
    loop.default_exception_handler(context)
Example #4
0
def exception_handler(loop: asyncio.AbstractEventLoop, context: Dict):
    loop.default_exception_handler(context)
    stop_loop(loop)