We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 14bc124 commit c7f099dCopy full SHA for c7f099d
1 file changed
tests/base.py
@@ -54,18 +54,11 @@ def _is_retryable_error(exc: Exception) -> bool:
54
if isinstance(exc, AssertionError):
55
return True
56
if isinstance(exc, StreamAPIException):
57
- if exc.status_code == 429:
+ if exc.status_code in (429, 502, 503, 504):
58
59
- if exc.status_code in (502, 503, 504):
60
- return True
61
- body = ""
62
- try:
63
- body = exc.http_response.text or ""
64
- except Exception:
65
- pass
66
- lowered = body.lower()
+ msg = str(exc).lower()
67
if any(
68
- phrase in lowered
+ phrase in msg
69
for phrase in (
70
"upstream connect error",
71
"disconnect",
0 commit comments