Update transport close/reset behaviour (#689)

Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
Steven B
2024-01-23 22:15:18 +00:00
committed by GitHub
parent e576fcdb46
commit 1788c50146
13 changed files with 66 additions and 43 deletions

View File

@@ -5,7 +5,11 @@ from typing import Any, Dict, Optional, Tuple, Union
import aiohttp
from .deviceconfig import DeviceConfig
from .exceptions import ConnectionException, SmartDeviceException, TimeoutException
from .exceptions import (
ConnectionException,
SmartDeviceException,
TimeoutException,
)
from .json import loads as json_loads
@@ -78,7 +82,7 @@ class HttpClient:
except (aiohttp.ServerDisconnectedError, aiohttp.ClientOSError) as ex:
raise ConnectionException(
f"Unable to connect to the device: {self._config.host}: {ex}", ex
f"Device connection error: {self._config.host}: {ex}", ex
) from ex
except (aiohttp.ServerTimeoutError, asyncio.TimeoutError) as ex:
raise TimeoutException(