Commit 1c3e8fc
committed
Client streamable-http: parse JSON-RPC errors from non-2xx response bodies
A spec-correct server may return the JSON-RPC error in an application/json body
at a non-2xx status (e.g. 400 for INVALID_PARAMS, 404 for METHOD_NOT_FOUND per
the 2026-07-28 transport binding). Surface that error to the caller instead of
synthesizing a generic INTERNAL_ERROR / 'Session terminated' from the status
alone. Falls back to the status-derived error if the body isn't valid JSON-RPC.
Unconditional (not version-gated): parsing a JSON-RPC body from a 4xx
application/json response is correct at any protocol version.1 parent 703cde1 commit 1c3e8fc
1 file changed
Lines changed: 16 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
314 | 314 | | |
315 | 315 | | |
316 | 316 | | |
317 | | - | |
318 | | - | |
319 | | - | |
320 | | - | |
321 | | - | |
322 | | - | |
323 | | - | |
324 | 317 | | |
325 | 318 | | |
326 | | - | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
327 | 335 | | |
328 | 336 | | |
329 | 337 | | |
| |||
0 commit comments