T
tRPC

Return TRPC Error from NextJS middleware

Return TRPC Error from NextJS middleware

TTom8/12/2023
I am using trpc for my app's api but Im using NextJS middleware + upstash ratelimitting for.... well ratelimitting. Is there a way return a TRPC error from the middleware route?
TTom8/13/2023
Bump?
AKAlex / KATT 🐱8/13/2023
Throw it and use an error formatter
TTom8/14/2023
well in the nextjs middleware i can't really throw it. i could superjson the error and res.send() it. would that work?

Looking for more? Join the community!

T
tRPC

Return TRPC Error from NextJS middleware

Join Server