mirror of
https://github.com/Niko1221/Strata.git
synced 2026-11-09 03:59:45 -10:00
bench_standard: a socket TimeoutError is reported as timeout, like the timer (Windows reported connection_TimeoutError when the socket fired first)
This commit is contained in:
1 parent
391f7ce8dc
commit
e8c3acd2d1
1 file changed
+1
-1
@@ -288,7 +288,7 @@ def stream_chat(target: Target, spec: dict, model: str | None, *, timeout_s: flo
|
||||
raw["interrupted"] = True
|
||||
raw["error"] = {"kind": "cancelled", "message": "cancelled by the operator"}
|
||||
except (OSError, http.client.HTTPException, ValueError) as exc:
|
||||
if raw["timed_out"]:
|
||||
if raw["timed_out"] or isinstance(exc, TimeoutError): # the socket's own timeout can fire just before the timer does (Windows)
|
||||
raw["error"] = {"kind": "timeout", "message": f"no complete answer within {timeout_s:g} seconds"}
|
||||
else:
|
||||
raw["error"] = {"kind": "connection_" + type(exc).__name__, "message": str(exc)[:200] or type(exc).__name__}
|
||||
|
||||
Reference in new issue
Block a user