Replace ClientConnectionResetError with ClientConnectionError

ClientConnectionResetError doesn't exist in older aiohttp releases (it was added in aiohttp 3.10+), so use ClientConnectionError which is the parent class to avoid increasing dependencies.
This commit is contained in:
Ken Link authored and DevilXD committed 2026-06-01 23:00:12 +02:00
1 parent b5e199301e
commit c5e6286c41
1 file changed
+2 -2
+2 -2
View File
@@ -249,7 +249,7 @@ class Websocket:
while True:
try:
raw_message: aiohttp.WSMessage = await ws.receive(timeout=timeout)
except aiohttp.ClientConnectionResetError:
except aiohttp.ClientConnectionError:
raise WebsocketClosed(received=False)
ws_logger.debug(f"Websocket[{self._idx}] received: {raw_message}")
if raw_message.type is WSMsgType.TEXT:
@@ -328,7 +328,7 @@ class Websocket:
message["nonce"] = create_nonce(CHARS_ASCII, 30)
try:
await ws.send_json(message, dumps=json_minify)
except aiohttp.ClientConnectionResetError:
except aiohttp.ClientConnectionError:
raise WebsocketClosed(received=False)
ws_logger.debug(f"Websocket[{self._idx}] sent: {message}")