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)
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)
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)
def exception_handler(loop: asyncio.AbstractEventLoop, context: Dict): loop.default_exception_handler(context) stop_loop(loop)