INNER CODE UNIT · Python

_is_expected_shutdown_error

FLOCK4H/Dexter · Dexter.py:433

    def _is_expected_shutdown_error(self, exc: BaseException) -> bool:
        if not (self.is_closing or self.stop_event.is_set()):
            return False
        if isinstance(
            exc,
            (
                ClientConnectionError,
                ConnectionError,
                TimeoutError,
                websockets.ConnectionClosed,
            ),
        ):
            return True
        message = str(exc).lower()
        return any(
            token in message
            for token in (
                "server disconnected",

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…