Lets say I have very simple Astro component which is fetching some data.
const data = await fetch("path-to-data.json").then((response) => response.json());
data.map(item => <h2>{item.title}</h2>)
If my data fetching failed I have error:
Failed to parse URL from path-to-data.json
I would like just to skip this “component”, if data fetch failed, not to break entire site.
How to do that? (Not with React, not Vue.. just Astro.js)
Thank you