Use TRPCClientError.cause in frontend
Hi all,
My TRPC route can sometimes fail. Say the error is
CartValidationError
In the frontend, I want to be able to do:
The problem is that the error is of type TRPCClientError. In the backend, I can see that the error.cause
is what has the real error (CartValidationError
)
Is there a way for me to make the backend return the error in it's original type so I can use instanceOf? If not, can I use error.cause in the frontend? (doesn't seem possible yet)0 Replies