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:
"NetworkError when attempting to fetch resource."
"Failed to fetch"
Stack doesn't seem to provide anything particularly useful.
Perhaps generally check if there is no error.response or error.status?
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
'scatch
may only haveerror.message
orerror.stack
. See alsoconsole.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
orerror.status
?