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

297
Visualizações
Catching an Error from axios.get() when bytes returned exceeds 1GB

I'm using axios to make an http GET request. In some situations my server is returning more than a GB of data causing an error. For a short term solution I want to catch the error and log it however I'm finding it difficult to catch the error. Using a .catch mentioned here, and in the axios documentation, I'm still unable to catch the error.

Error

buffer.js:776
    return this.utf8Slice(start, end);
                ^
Error: Cannot create a string longer than 0x3fffffe7 characters

Example Requests / What I've tried

// without a catch
const res = await axios.get<string, AxiosResponse<Record<string, any>>>("http://foo.bar/huge_string_response");

// with a catch, still throws
const res = await axios
    .get<string, AxiosResponse<Record<string, any>>>("http://foo.bar/huge_string_response")
    .catch((err) => {console.log("error: " + err); });
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