Customizing the TRPCError type
I can't find anything in the docs about customizing the TRPCError type if I need to transmit extra properties etc along with the errors, or adding custom error codes. Can I amend the TRPCError type with my own interface?
What is the "correct" way to do this?
2 Replies
hi, did you figure this out. I am also curious
@Emmie Päivärinta https://trpc.io/docs/server/error-formatting#adding-custom-formatting
Error Formatting | tRPC
The error formatting in your router will be inferred all the way to your client (& React components)