To be honest, I never got a great answer. So I just manually worked around it on the client side. So if I ever got a json error from my service I assume it was the middleware rejecting it
working with custom errors and trpc errorFormatter
but then i want to enforce a rule in my error formatter that says 'for security reasons, i dont want to return UNAUTHORIZED because that tells the client that this resource exists. I want to convert this to NOT_FOUND'
working with custom errors and trpc errorFormatter
but even if i know all the parameters that i would pass to a TRPCError, once its in the error formatter it seems that I lose the ability to replicate the same exact shape