linkeddata / dokieli

:bulb: dokieli is a clientside editor for decentralised article publishing, annotations and social interactions
https://dokie.li/
Other
788 stars 81 forks source link

Catch and handle NetworkError when attempting to fetch resource #384

Open csarven opened 4 months ago

csarven commented 4 months ago

When there is a network error, e.g., TCP handshake didn't occur, handle it properly all the way to the UI informing the user, e.g., "the thing you are trying to communicate with is unavailable (taking a bath), try again later or check the cables in the ocean."

A fetch's catch may only have error.message or error.stack. See also console.dir(error).

Not sure if error.message is standardised in any way, but cursory check with Firefox and Brave shows:

Stack doesn't seem to provide anything particularly useful.

Perhaps generally check if there is no error.response or error.status?