Commit f9ca942
fix(client): return empty bundles on 404 instead of crashing (#16)
get_bundles() subscripted the None that fetch_resource returns on any
non-200 response, so an item deleted since the cache was built (404)
raised "'NoneType' object is not subscriptable" during a bitstream
export - a scary CRITICAL line for what is really just "this item is gone".
Record the failing response as _last_err in fetch_resource so callers can
tell a gone resource (404) from a transient 5xx, then in get_bundles treat
a 404 as a clean empty result. Any other failure still falls through and
surfaces to the caller, so it keeps its retry and failure counting.
Co-authored-by: jm <jm@maz>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>1 parent d3c8673 commit f9ca942
1 file changed
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
475 | 475 | | |
476 | 476 | | |
477 | 477 | | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
478 | 481 | | |
479 | 482 | | |
480 | 483 | | |
| |||
698 | 701 | | |
699 | 702 | | |
700 | 703 | | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
701 | 710 | | |
702 | 711 | | |
703 | 712 | | |
| |||
0 commit comments