mirror of
https://github.com/usestrix/strix.git
synced 2026-10-12 03:47:56 +00:00
fix: don't retry 404
This commit is contained in:
parent
15941e080d
commit
8b249109bb
2 changed files with 2 additions and 3 deletions
|
|
@ -184,7 +184,7 @@ def _is_transient_model_error(exc: BaseException) -> bool:
|
|||
return True
|
||||
code = _model_error_status_code(exc)
|
||||
if code is not None:
|
||||
return code >= 400 and code not in (401, 402, 403)
|
||||
return code >= 400 and code not in (401, 402, 403, 404)
|
||||
return isinstance(exc, APIError)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -84,8 +84,7 @@ def test_client_errors_are_transient() -> None:
|
|||
"bad", response=httpx.Response(400, request=_request()), body=None
|
||||
)
|
||||
assert execution._is_transient_model_error(bad_request) is True
|
||||
assert execution._is_transient_model_error(_status_error(404)) is True
|
||||
for status in (401, 402, 403):
|
||||
for status in (401, 402, 403, 404):
|
||||
assert execution._is_transient_model_error(_status_error(status)) is False
|
||||
assert execution._is_transient_model_error(ValueError("nope")) is False
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue