SolidJSS
SolidJSโ€ข2y agoโ€ข
5 replies
ish

Handling errors in createResource

My createResource handle fetches data from a REST API and is displayed on the screen. I have interval that calls refetch to refresh the data.

If the fetch fails, my interval will keep running, and even if the remote service comes up, the refetch occurs, but the page never renders the new data.

Is there a better way to handle errors in my resource? I don't want to try catch and return no data, as I want to display the existing data until new data can be retrieved.
Was this page helpful?