dirigent-plugin 0.16.0__tar.gz → 0.16.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {dirigent_plugin-0.16.0 → dirigent_plugin-0.16.1}/PKG-INFO +1 -1
- {dirigent_plugin-0.16.0 → dirigent_plugin-0.16.1}/pyproject.toml +1 -1
- {dirigent_plugin-0.16.0 → dirigent_plugin-0.16.1}/pyproject.toml.orig +1 -1
- {dirigent_plugin-0.16.0 → dirigent_plugin-0.16.1}/src/dirigent_plugin/blocks.py +7 -3
- {dirigent_plugin-0.16.0 → dirigent_plugin-0.16.1}/LICENSE +0 -0
- {dirigent_plugin-0.16.0 → dirigent_plugin-0.16.1}/README.md +0 -0
- {dirigent_plugin-0.16.0 → dirigent_plugin-0.16.1}/src/dirigent_plugin/__init__.py +0 -0
- {dirigent_plugin-0.16.0 → dirigent_plugin-0.16.1}/src/dirigent_plugin/markers.py +0 -0
- {dirigent_plugin-0.16.0 → dirigent_plugin-0.16.1}/src/dirigent_plugin/py.typed +0 -0
- {dirigent_plugin-0.16.0 → dirigent_plugin-0.16.1}/src/dirigent_plugin/transforms.py +0 -0
|
@@ -43,7 +43,7 @@ class ErrorClass(StrEnum):
|
|
|
43
43
|
"""Network, 5xx, timeout: retryable."""
|
|
44
44
|
|
|
45
45
|
REJECTED = "rejected"
|
|
46
|
-
"""Validation, auth, 4xx: never retried."""
|
|
46
|
+
"""Validation, auth, any 4xx but 429: never retried."""
|
|
47
47
|
|
|
48
48
|
UNKNOWN = "unknown"
|
|
49
49
|
"""Anything else: retried while the step's budget lasts."""
|
|
@@ -64,13 +64,17 @@ class BlockFailure(Exception):
|
|
|
64
64
|
|
|
65
65
|
|
|
66
66
|
def classify_default(error: Exception) -> ErrorClass:
|
|
67
|
-
"""Classify an exception with no block-specific knowledge: transport and 5xx transient, 4xx rejected.
|
|
67
|
+
"""Classify an exception with no block-specific knowledge: transport and 5xx transient, 4xx rejected.
|
|
68
|
+
|
|
69
|
+
A 429 is the one client error that asks to be retried: the server is rate limiting, and
|
|
70
|
+
the same call succeeds once the window has passed.
|
|
71
|
+
"""
|
|
68
72
|
match error:
|
|
69
73
|
case BlockFailure():
|
|
70
74
|
return error.error_class
|
|
71
75
|
case httpx2.HTTPStatusError():
|
|
72
76
|
status = error.response.status_code
|
|
73
|
-
if status >= 500:
|
|
77
|
+
if status >= 500 or status == 429:
|
|
74
78
|
return ErrorClass.TRANSIENT
|
|
75
79
|
if 400 <= status < 500:
|
|
76
80
|
return ErrorClass.REJECTED
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|