VelzV
Convex Community7mo ago
1 reply
Velz

How to handle ConvexError on client?

Hi,
Following the docs on Application Errors, I am throwing new ConvexError('here's Error') in my mutation, and on client try to catch it in this way
  try {
    myMutation();
  } catch (e: unknown) {
    if (e instanceof ConvexError){ 
      console.log(e.data);
    }
  }


However, it does not seem to be working. I see Uncaught ConvexError in my console, but I am not able to handle it on the client for some reason.

I also. tried to follow what AI docs suggested: checking for whether data is present inside the e, but that also isn't working.

Curious if there are any gotchas I might be missing?

Thanks!
Was this page helpful?