thibault
Basic error handling patterns
Hello guys I am playing around with trpc and I don't know how to do error handling at a route level. I did read the docs about error handling but I don't know if my approach to this problem is good. How do you guys would handle errors in trpc ?
For example I have this sign up route. And the way I am doing error handling is by re throwing a TRPCError in the catch clause. Which doesn't seems right.
I also try to use the middleware approach but that doesn't work since trpc override the error constructor.
2 replies