-
-
Notifications
You must be signed in to change notification settings - Fork 10.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to Check if Axios Call Fails due to No Internet Connection? #2986
Comments
You shouldn't rely on axios or any http library to determine the internet connectivity, cause it can't distinguish between If you don't care about the difference between the 2 states, refer If you want to check the network connectivity on browser, refer
|
@mayank-mittal Thanks |
If you're using Expo with React Native, there's a Network API. |
Well, you kinda can't, at least not with axios, you have to use another library because:
But there is a workaround to wait some time and if there isn't a response it means that it will be an internet problem. |
I'm trying to figure out an accurate way to detect axios call failure due to no internet connection.
Does axios call failure return a specific response object or specific response status code or throw a specific error details for the no internet connection scenario?
Example of what i will use the "detection of axios failure due to no internet connection" for
The text was updated successfully, but these errors were encountered: