Varun SinghV
Convex Community3y ago
5 replies
Varun Singh

Does ConvexError replace Error?

Normally, when I create REST APIs, I distinguish between errors that are the fault of the user (do not have permission) and those of the developer (500 internal server error, etc.) through the status codes. With Convex, as the documentation says, it is better to throw errors that are then caught directly on the front-end.

I am thinking about using ConvexError for developer errors and Error for user errors. Is ConvexError supposed to be used for all errors, or is this up to the developer? Additionally, since these will both be thrown on the frontend, what is the recommended way I distinguish between them in my ErrorBoundary?
Was this page helpful?