Commit 9b7e932
fix(telegram): gate malformed-body recovery by HTTP status (4xx non-recoverable)
ClawSweeper flagged that the malformed-json snippet is too broad: a 4xx
response (bad token, apiRoot misconfig) with a non-JSON body would match
the snippet and retry indefinitely instead of surfacing as a fatal polling
error.
Split the fetchJson catch: 4xx client errors produce a message without
"malformed json", so the polling loop treats them as non-recoverable
(fatal). Server/transient statuses (5xx, 2xx) keep the recoverable path
(backoff retry).
Add 4xx regression test.
Co-Authored-By: Claude <[email protected]>1 parent b5bd98b commit 9b7e932
1 file changed
Lines changed: 17 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
158 | 175 | | |
159 | 176 | | |
160 | 177 | | |
| |||
0 commit comments