jonasmerlin
jonasmerlin11mo ago

Where is client side error handling documented?

In the docs, I can only find error handling for the backend. But I want to get the TRPCError code in the frontend.
3 Replies
jonasmerlin
jonasmerlin11mo ago
Basically, I want to get the code on the client side. Is that posible?
Alex / KATT 🐱
Alex / KATT 🐱11mo ago
Error Formatting | tRPC
The error formatting in your router will be inferred all the way to your client (& React components)
aryzing
aryzing11mo ago
@Alex / KATT 🐱 in the docs linked above, where does trpc.addPost.useMutation() come from? .useMutation() doesn't exist