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

323
Visualizações
Getting UnhandledPromiseRejectionWarning: Error: write EPROTO when running my async await function in NodeJS

I was running the below code without any issue up until this afternoon, I did not change or update anything, not sure what is causing this:

async function getStocks(){

    const { data } = await axios.get('https://gist.githubusercontent.com/graffixnyc/8c363d85e61863ac044097c0d199dbcc/raw/7d79752a9342ac97e4953bce23db0388a39642bf/stocks.json')
    return data // this will be the array of people objects
}

async function abc(){
    let a = await getStocks()
    console.log(a)
}

abc()

It used to render the entire data from the JSON file but now throws the below error:

(node:1860) UnhandledPromiseRejectionWarning: Error: write EPROTO 14520:error:1408F10B:SSL ` 
routines:ssl3_get_record:wrong version 
number:c:\ws\deps\openssl\openssl\ssl\record\ssl3_record.c:332:`

I am not sure which dependency has the wrong version since I did not update the code nor made any changes.

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

The data on the website sent an invalid response, so the issue was not in the code but the website data itself.

about 4 years ago · Juan Pablo Isaza Relatório

0

Try adding Try Catch to your functions.

about 4 years ago · Juan Pablo Isaza Relatório
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