Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

284
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda