Commit 770d9ca
fix: graciouslyFetch returns undefined on network error, crashes updates_for callers
When a fetch fails (network error, CORS, timeout), graciouslyFetch()
catches the error but implicitly returns undefined. Callers in
updates_for_element.js then crash with TypeError when calling .text()
on the undefined result.
Fix: return new Response('') in the catch block so callers always
receive a valid Response object. Also add defensive guards at both
call sites for defense in depth.
Fixes #310
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent ee1c8b1 commit 770d9ca
2 files changed
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | | - | |
| 123 | + | |
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
| |||
254 | 254 | | |
255 | 255 | | |
256 | 256 | | |
257 | | - | |
| 257 | + | |
258 | 258 | | |
259 | 259 | | |
260 | 260 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
| 205 | + | |
205 | 206 | | |
206 | 207 | | |
207 | 208 | | |
| |||
0 commit comments