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

143
Visualizações
where to implement window.onerror method on a react project

I want to send my frontend logs to backend on react project. where can i implement window.onerror method so all of the unhandled exceptions will be thrown to backend within that method.

is it possible to write this method to app.js or something so all errors will be captured. Or should I add this method to all of my components

about 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

this post really helped me alot github.com/facebook/react/issues/19613

I wrote below Event listener in src/index.js and it raises error

window.addEventListener('error', (event) => {
  console.log(Error(event.message ?? event));
  const { message, filename, lineno, colno, error } = event;
  console.log('Captured uncaught error:', message, filename, lineno, colno, error.stack);
})
about 4 years ago · Santiago Trujillo 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