Validate the HTTP contract before you render anything
`fetch()` does not reject on most HTTP errors, so that responsibility is yours.
A `404` or `500` response still resolves as a `Response` object at the promise level. It is not automatically a rejected promise.
That is why a safe flow usually looks like this: request, validate `ok` or `status`, parse, then update the interface.
Request
Launch the HTTP call.
- correct method
- correct headers
Validate
Check `res.ok` or `res.status`.
- do not assume success
- throw with context
Parse
`res.json()` can fail too.
- expected format
- guard the flow
Render
Update the UI deliberately.
- loading/success/error
- cleanup in `finally`