mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-08-09 20:24:02 +00:00
Raise kasa TimeoutError instead of _RetryableError on asyncio.TimeoutError
This commit is contained in:
@@ -23,6 +23,7 @@ from collections.abc import Generator
|
||||
|
||||
from kasa.deviceconfig import DeviceConfig
|
||||
from kasa.exceptions import KasaException, _RetryableError
|
||||
from kasa.exceptions import TimeoutError as KasaTimeoutError
|
||||
from kasa.json import loads as json_loads
|
||||
|
||||
from .basetransport import BaseTransport
|
||||
@@ -128,7 +129,7 @@ class XorTransport(BaseTransport):
|
||||
await self._connect(self._timeout)
|
||||
except TimeoutError as ex:
|
||||
await self.reset()
|
||||
raise _RetryableError(
|
||||
raise KasaTimeoutError(
|
||||
f"Timeout after {self._timeout} seconds connecting to the device:"
|
||||
f" {self._host}:{self._port}: {ex}"
|
||||
) from ex
|
||||
@@ -167,7 +168,7 @@ class XorTransport(BaseTransport):
|
||||
return await self._execute_send(request)
|
||||
except TimeoutError as ex:
|
||||
await self.reset()
|
||||
raise _RetryableError(
|
||||
raise KasaTimeoutError(
|
||||
f"Timeout after {self._timeout} seconds sending request to the device"
|
||||
f" {self._host}:{self._port}: {ex}"
|
||||
) from ex
|
||||
|
Reference in New Issue
Block a user