Error handling
Hey all, what's a recommended approach for error handling? Right now, I'm just throwing generic Errors all over the place.
How could I throw specific typed errors? For example, OpenAIError. I'd like to handle them differently on the UI.
2 Replies
You can throw ConvexError which contains data that the client can receive and identify. See https://docs.convex.dev/functions/error-handling/application-errors
Application Errors | Convex Developer Hub
If you have expected ways your functions might fail, you can either return
This is amazing. God.. I love convex.
Thanks @lee 🙏