Commit 8534615
committed
refactor: unify error classification into shared _classify_transient helper
Extract the per-exception type matching from _classify_chunk_error into
a new _classify_transient(exc) helper that classifies a SINGLE exception
(no chain walk) into (interrupted_class, retry_after) | None.
_classify_chunk_error now calls _classify_transient on each step of its
__cause__ walk. _retryable continues to inspect only the top-level
exception (preserving the intentional divergence: initial-page raw
transients are cheap to retry; wrapped mid-pagination failures escalate
to a resumable ChunkInterrupted instead).
When a new transient error type needs recognition, it now goes in ONE
place (_classify_transient) and both the retry and escalation paths pick
it up automatically.1 parent 3eda250 commit 8534615
1 file changed
Lines changed: 39 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
193 | 225 | | |
194 | 226 | | |
195 | 227 | | |
| |||
231 | 263 | | |
232 | 264 | | |
233 | 265 | | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
240 | 269 | | |
241 | 270 | | |
242 | 271 | | |
| |||
262 | 291 | | |
263 | 292 | | |
264 | 293 | | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
265 | 298 | | |
266 | 299 | | |
267 | 300 | | |
| |||
0 commit comments