Ryan Gillie
Ryan Gillie3y ago

Transform Errors

I get really lazy with my prisma try / catch and was wondering the best place to handle those errors and make them more generic for the front end. I've looked at both https://trpc.io/docs/error-formatting and https://trpc.io/docs/error-handling, but not super sure which one it would be handled in. Basically I just want to check if it's a prisma error, change it to a generic error, and change the message so the users won't know a unique key lookup failed for example
1 Reply
Nick
Nick3y ago
Probably the error formatter, it’s basically for exactly what you describe!

Did you find this page helpful?