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

192
Visualizações
How to handel "net::ERR_QUIC_PROTOCOL_ERROR 200" in a fetch?

By simulating a Lie-Fi connection I noticed that I get an (net::ERR_QUIC_PROTOCOL_ERROR) error that didn't triggered the catch part of the fetch statement. The reason that the fetch wasn't triggered is that the status code of the network request returned 200. Why is this Error OK (200)?.

But the main question is how can I detect and handle these errors?

This question gets more interesting in case the fetch is part of a fetch event handel of a serviceworker. For when the serviceworker tries to fetch something from the internet and if that isn't possible returns a result from the cache. These errors however will not be seen as an error and therefore the data from the cache will not be returned. As a user I then will not get the offline experience I would expect.

// please set Network Throttling to Lie-Fi (1kbit/s up&down)
const timeoutSimulation = () => {
  return fetch('https://thispersondoesnotexist.com/image', {mode: 'no-cors'})
    .then((response) => {
      console.log(`would not expect to see this message, due to the net error`);
      return response;
    })
    .catch((error) => {
      console.log('expect this error to be shown', error);
    })
}
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