Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

140
Views
Skip unreachable URLs in Axios fetch call

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.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!