Open the reply’s box at Wulan’s counter: the stamp and headers read any time, and the body? Write .json()/.text()/.blob()/.clone() and run it for real. An…
The two most common bugs around fetch: "why does a 404 not reach catch?" (fetch does not throw for 4xx/5xx) and "body stream already read" when a reply is read twice (say .text() for a log, then .json()). Knowing Response means correct error handling and no tripping over a one-use body.
fetch resolves on a 404, and a body reads only once
await fetch() throws on a 404/500 It does not. fetch only rejects when the network fails. Add if (!res.ok) throw new Error(res.status) yourself for 4xx/5xx..text() to log, then .json()) The second read: TypeError: body stream already read. Keep the first result, or res.clone() before reading..json() on a 204 / an empty body An empty body makes .json() a SyntaxError: Unexpected end of JSON input. Check res.status === 204 or the content-type before parsing.TypeError, the box is already empty.res.json() on the 204 A success (2xx) with no body: res.json() is a SyntaxError.res.clone() before reading Two boxes, two reads, no error.res.ok is false, nothing is thrown.