Make ArgumentValidationError a class and expose it so a client can identify it
Feature Request
Make
ConvexClient query throw identifiable error when ArgumentValidationError heppened. So caller of it can handle it.The setup
convex query function
I'm calling convex like this, and it throws error
What happened
The error is a generic
Error I believe. I can identify it by err.message.includes("ArgumentValidationError"). But it only works for development. Production error is like Error: [CONVEX Q(products:getProduct)] [Request ID: df413dad71c22523] Server Error.Development Error:
[CONVEX Q(products:getProduct)] [Request ID: 0750239d5647b2fb] Server Error
ArgumentValidationError: Found ID "jh7an9ffvzx6jaa4fadxnk7zz180zr1q" from table, which does not match the table name in validatorproductCategories.Path: ._idv.id("products")
Called by client
Production Error:
[CONVEX Q(products:getProduct)] [Request ID: 1fc968523fcb6eaf] Server Error
Called by client
What I wanna do (in case you need to know)
I want catch that error, in middleware of oRPC, and provide 400 response with sensible message for my client so they know they're passing the wrong
id.