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

288
Visualizações
Prevent Apollo Server error form crashing browser

I am trying to prevent any error thrown from my server crash the browser. I have tried with try-catch but also with the apollo-link-error's onError Link. The behaviour I am looking for is , instead of crashing the app , display something from my client. What I have tried:

onSubmit={(values)=>
          try{
logIn({variables:{"name":values.name,"email":values.email}})
}catch(err){
return (err)
}


if(error) return <p>An error occured</p>

But also with apollo-link-error:

const errorLink=onError(({graphQLError,networkError})=>{
   if(graphQLError){
    return "There was a problem"
}
}

The errorLink only does throw this error in my console , but it does not also present the behaviour I had hoped: prevent the app from crashing. Could you please let me know what to do?

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