Explained solution 09: Load, fail and recover
A: the first await obtains the response; the second reads and parses its body. A 404 response normally fulfills the fetch promise and requires an explicit response.ok check. JSON syntax alone does not prove the fields are usable.
B: normal shows six events, empty shows a distinct empty message, and the other three show failure with a retryable button. A missing file has HTTP 404; malformed JSON fails parsing; wrong shape fails our own check. finally restores controls for all these paths.
C: replace the existing shape test with:
const valid = Array.isArray(data) && data.every((item) => {
return item !== null && typeof item === "object"
&& typeof item.title === "string" && item.title.trim() !== ""
&& Number.isInteger(item.places) && item.places >= 0;
});
if (!valid) throw new Error("Invalid event data");
A failing fixture is [{"title":"Garden morning","places":-1}]. The capstone's validator goes further by checking unique IDs, allowed categories and date-only values. Those checks reflect its renderer's contract, rather than a claim that every imaginable data problem is covered.