I'm using supabase, and other custom errors within my trpc procedures. The errors thrown are all converted to TRPC errors INTERNAL_SERVER_ERROR, when some of these errors should be converted to other type of TRPC errors. How can i manage this ?
I tried the onError handler, but its too late at this point. the error is already a TRPC error. I tried using a middleware as well, but the errors throw are not caught by the middleware.
Whenever an error occurs in a procedure, tRPC responds to the client with an object that includes an "error" property. This property contains all the information that you need to handle the error in the client.
Continue the conversation
Join the Discord to ask follow-up questions and connect with the community
t
tRPC
Move Fast & Break Nothing. End-to-end typesafe APIs made easy.