Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

289
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!