You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using T3 stack(using Supabase instead of NextAuth). I want to handle the case when trpc returns an error, such as when I haven't provided a cookie to protectedProcedure, it returns an UNAUTHORIZED error with status code 401. I'd like to handle this error directly in the API route, but currently, the code always returns a status code of 200, and the error code is wrapped inside. How should I handle this?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm using T3 stack(using Supabase instead of NextAuth). I want to handle the case when trpc returns an error, such as when I haven't provided a cookie to protectedProcedure, it returns an UNAUTHORIZED error with status code 401. I'd like to handle this error directly in the API route, but currently, the code always returns a status code of 200, and the error code is wrapped inside. How should I handle this?
Beta Was this translation helpful? Give feedback.
All reactions