TRPC & Zod Logging
I'm building a backend and if my input validation fails I want to log the failure but couldn't figure out a way as trpc seems to handle the error straigth away, anyone know how this could be done?
2 Replies
I think you can do that in the errorFormatter method on the initTRPC.create function call, like so:
Yep i saw this, but what if i want to log a specific error to my db e.g. 'validation failed on login'