mirror of
https://github.com/python-kasa/python-kasa.git
synced 2026-10-07 13:23:55 +00:00
Disable multi requests on timeout during multi-request (#1759)
_execute_multiple_query only disables batching on JSON_DECODE_FAIL_ERROR / INTERNAL_UNKNOWN_ERROR (#1025). This change applies the same pattern to a TimeoutError raised while sending a batch: set the batch size to 1 and raise _RetryableError. --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import builtins
|
||||
import re
|
||||
|
||||
import aiohttp
|
||||
@@ -35,6 +36,13 @@ from kasa.httpclient import HttpClient
|
||||
TimeoutError,
|
||||
"Unable to query the device, timed out: ",
|
||||
),
|
||||
# aiohttp raises the builtin TimeoutError when ClientTimeout(total=...)
|
||||
# expires after the connection is established.
|
||||
(
|
||||
builtins.TimeoutError(),
|
||||
TimeoutError,
|
||||
"Unable to query the device, timed out: ",
|
||||
),
|
||||
(Exception(), KasaException, "Unable to query the device: "),
|
||||
(
|
||||
aiohttp.ServerFingerprintMismatch(b"exp", b"got", "host", 1),
|
||||
@@ -47,6 +55,7 @@ from kasa.httpclient import HttpClient
|
||||
"ClientOSError",
|
||||
"ServerTimeoutError",
|
||||
"TimeoutError",
|
||||
"BuiltinTimeoutError",
|
||||
"Exception",
|
||||
"ServerFingerprintMismatch",
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user