import logging
from math import inf
from platform import python_version
+import traceback
import aiohttp
from oauthlib.oauth1 import Client as OAuthClient
except (aiohttp.ClientConnectionError,
aiohttp.ClientPayloadError) as e:
await self.on_connection_error()
+ # The error text is logged here instead of in
+ # on_connection_error to keep on_connection_error
+ # backwards-compatible. In a future version, the error
+ # should be passed to on_connection_error.
+ log.error(
+ "Connection error: %s",
+ "".join(
+ traceback.format_exception_only(type(e), e)
+ ).rstrip()
+ )
await asyncio.sleep(network_error_wait)
from math import inf
from platform import python_version
import ssl
+import traceback
from threading import Thread
from time import sleep
from typing import NamedTuple
self.on_connection_error()
if not self.running:
break
+ # The error text is logged here instead of in
+ # on_connection_error to keep on_connection_error
+ # backwards-compatible. In a future version, the error
+ # should be passed to on_connection_error.
+ log.error(
+ "Connection error: %s",
+ "".join(
+ traceback.format_exception_only(type(exc), exc)
+ ).rstrip()
+ )
sleep(network_error_wait)