Tom
Tom
Explore posts from servers
TtRPC
Created by Tom on 8/12/2023 in #❓-help
Return TRPC Error from NextJS middleware
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
39 replies
TtRPC
Created by Tom on 11/4/2023 in #❓-help
is there a way to do client-side "middleware"?
unless, are you saying theres a function that will set headers before?
7 replies
TtRPC
Created by Tom on 11/4/2023 in #❓-help
is there a way to do client-side "middleware"?
im not sure how that solves the problem. that would allow me to send headers to the server but i need to call this function on the client
7 replies
TtRPC
Created by Tom on 10/18/2023 in #❓-help
working with custom errors and trpc errorFormatter
is that accurate?
29 replies
TtRPC
Created by Tom on 10/18/2023 in #❓-help
working with custom errors and trpc errorFormatter
as far as i can tell, i cant really do that
29 replies
TtRPC
Created by Tom on 10/18/2023 in #❓-help
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'
29 replies
TtRPC
Created by Tom on 10/18/2023 in #❓-help
working with custom errors and trpc errorFormatter
lets say I have TRPCError({message: "You aren't allowed to see this", code: 'UNAUTHORIZED'})
29 replies
TtRPC
Created by Tom on 10/18/2023 in #❓-help
working with custom errors and trpc errorFormatter
i guess a simpler, but still practical, example would be like
29 replies
TtRPC
Created by Tom on 10/18/2023 in #❓-help
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
29 replies
TtRPC
Created by Tom on 10/18/2023 in #❓-help
working with custom errors and trpc errorFormatter
if i only ever threw TRPCErrors then everything would work fine (which is what my app has been doing up to this point)
29 replies
TtRPC
Created by Tom on 10/18/2023 in #❓-help
working with custom errors and trpc errorFormatter
the problem im having is that i cant figure out how to take a non-trpc error in the error formatter and make it the same shape as a native trpc error
29 replies
TtRPC
Created by Tom on 10/18/2023 in #❓-help
working with custom errors and trpc errorFormatter
I'm not trying to think in HTTP. openapi-trpc should do that for me (at least thats the theory)
29 replies
TtRPC
Created by Tom on 10/18/2023 in #❓-help
working with custom errors and trpc errorFormatter
im also not sure if im handling stack correctly. will it still properly get omitted in production builds?
29 replies