I call a range of IPs with axios to get some jsons. Some IPs are not reachable and this is expected. How can I skip those and continue with showOutput(responding_IPs)?
ip_range = [ "10.0.0.1", "10.0.0.2", "10.0.0.3" ]; // hard-coded as example
let promiseArray = ip_range.map(url => axios.get('http://' + url + '/settings'));
axios.all(promiseArray)
.then(res => showOutput(res, ip_range))
.catch(err => console.error("Error: At least one IP is not reachable"));
If there needs to be a timer, 2 seconds would be enough.
btw I want to switch from then to await in the next step.