Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

139
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda