trpc error formatting
@trpc/server
@trpc/next@trpc/client
@trpc/react
@trpc/next@trpc/client
@trpc/reactHello,
I am wondering if it is possible to properly type my "cause.code"? I am hoping to create custom error codes so my frontend can decide which type of UI to display to the user. But, ideally this would be in a typesafe way so im not guessing what the error codes are. Is there a way i can tell trpc this, without having to use
client:
server:
I am wondering if it is possible to properly type my "cause.code"? I am hoping to create custom error codes so my frontend can decide which type of UI to display to the user. But, ideally this would be in a typesafe way so im not guessing what the error codes are. Is there a way i can tell trpc this, without having to use
as CustomErrorCodes in every instance I want to use it in?client:
server: