Repository navigation
Commit ed70e0e
fix(errors): make RetryBudgetExhaustedError picklable + tighten str() assertion
Keyword-only __init__ breaks Python's default exception pickle protocol
(unpickle calls cls(str_message) positionally). Mirror StatusError's pattern:
add _reconstruct_budget_exhausted + __reduce__. A budget-exhausted error is
the most likely error to cross process boundaries (the budget exists to
protect against load), so silently losing diagnostic context via UnpicklingError
would be bad.
Also tightens the summary-message test from "'5' in str(exc)" to an exact-string
match — the digit-in-string check would pass for many wrong messages.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent f383fc0 commit ed70e0e
2 files changed
Lines changed: 34 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
149 | 158 | | |
150 | 159 | | |
151 | 160 | | |
| |||
168 | 177 | | |
169 | 178 | | |
170 | 179 | | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
192 | | - | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
0 commit comments