Fetch, Errors, and Cancellation
Build robust network flows with status checks, timeouts, cancellation, and honest error states.
Lesson introduction
fetch rejects for network failures, not ordinary HTTP error statuses. Check response.ok, parse only the expected content type, and distinguish cancellation from real failure. Never expose raw server internals to users.
Where this fits
This lesson builds one part of the path from language fundamentals to complete browser applications.
What you will build
Name the response property that is true for HTTP status codes from 200 through 299.
You will first study the underlying rule, then trace worked code, repair a mistake, and create an independent solution.