Skip to content
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

net::ERR_INTERNET_DISCONNECTED #1236

Closed
luisAzcuaga opened this issue Oct 1, 2018 · 3 comments
Closed

net::ERR_INTERNET_DISCONNECTED #1236

luisAzcuaga opened this issue Oct 1, 2018 · 3 comments

Comments

@luisAzcuaga
Copy link

I'm currently working on an app that I managed to store the needed response from the server, altho, whenever I turn off wifi (or disconnect from the current WiFi network) I get this annoying net::ERR_INTERNET_DISCONNECTED. I know It's obious It's trying to connect to the server, but how to I set the socket to ignore that fact?

I'm using Ionic 3.20 and this cordova plugin socket.io-client.

@BigEEE
Copy link

BigEEE commented Oct 4, 2018

just use cordova events for online and offline, and stop connecting when the device is offline

@luisAzcuaga
Copy link
Author

Do you mean on this.socket.on('offline',()=>) ?

My workaround so far is, whenever an error from server is received make an obsersable.complete(); in the .ts that handles the response, rather than the .ts that manages the socket.

@darrachequesne
Copy link
Member

For future readers: ERR_INTERNET_DISCONNECTED errors are emitted by the browser itself, and there is unfortunately nothing that we can do to silence them.

Added in the documentation here: https://socket.io/docs/v3/logging-and-debugging/#Error-logs-in-the-browser-console

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants