internet-available
internet-available copied to clipboard
Error information when catch
Is it possible to log the error in the catch to see where is the source of the failed internet connection?
In my case, it happens something really weird. It seems to enter both the .then and the .catch methods. But actually I'm having an internet connection (verified).
Here is the code:
var onlineCheck = function(timeout_, retires_, callback) {
internetAvailable({
// Provide maximum execution time for the verification
timeout: timeout_,
// If it tries 5 times and it fails, then it will throw no internet
retries: retires_
}).then(() => {
console.log("INTERNET AVAILABLE");
callback();
}).catch(() => {
console.log("NO INTERNET");
});
}
function call from app.js:
InternetAv.onlineCheck(5000, 30, InternetAv.startTunnel());
I recieve both messages in the console: INTERNET AVAILABLE and NO INTERNET.
That's why I would like to know if there is a way to log more information when catching. Thank you!
#1 @https://j-freeslotonline.blogspot.com/?m=1`