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

343
Visualizações
How to pinpoint root cause of sporadic XHR error 0 (Network Error)?

I run a SaaS, and we use LogRocket to monitor customers' screens so it's easier to troubleshoot issues when things go wrong. One issue that's been really elusive lately is an "error 0".

All that Sentry logs is "Network Error" which isn't helpful, and a 0 response from an XHR PATCH request. Here's what the API calls made from the customer's browser look like in LogRocket:

Screenshot of HTTP calls logged in LogRocket

This is what I find baffling: there are previous successful calls to the API (AWS API Gateway, by the way). And when I watch the user's screen at the time of that error, there's no kind of interruption such as a page reload, or the user closing the tab, which I think are typical reasons for error 0.

This is totally sporadic. I'm looking for any advice on how to find out what's causing this, because I'm at a loss here. Thanks!

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

0

If it's actually an abort that's causing this, this may help you capture it.

const trigger = document.getElementById("trigger");
const display = document.getElementById("display");
const toggle = document.getElementById("toggle");

const url = "https://api.coingecko.com/api/v3/exchanges?per_page=500";

trigger.addEventListener("click", sendRequest);

async function sendRequest() {
  const controller = new AbortController();
  const { signal } = controller;
  
  let timerId;
  
  if (toggle.checked) timerId = setTimeout(() => controller.abort(), 20);
  
  try {
    const response = await fetch(url, { signal });
    console.log(response);
    display.innerText = response.status;
  } catch (err) {
    console.log(err);
    display.innerText = err;
  }  
  
  if (timerId) clearTimeout(timerId);
}
<button id="trigger">Start</button>
<label for="toggle">Show abort</label><input type="checkbox" id="toggle" />
<div id="display"></div>

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