How to detect that an operation has failed due to an internet connection problem?

Im trying to determine from the error-link if a request has failed due to lack of internet connection, but I haven’t found any clear solution. What Im doing right now is checking if the network errors + graphql errors are empty, and that seems to work, but Im not sure if its the best solution.

Anyone knows?

Thanks

Never tried it before but are you able to look at the HTTP status code?
If yes, maybe that could help you determine the response type and act on that.

From my tests, whenever there’s a failure due to internet connectivity, the network error is empty, so I can’t extract any HTTP status code from it.

Did you try to look at the networkStatus variable instead or maybe something like this?