trpc/app-router surfacing trpc errors in `error.tsx`?
[i already posted this on trpc discord but not getting anything over there so figured i'd see if anyone here might know]
I've got this condition for throwing in my trpc procedure:
and on client I have a next13
error.tsx
route, in which I do:
errorCode
is always 500 when we throw from that condition. No matter the code I pass when I throw2 Replies
The errorCode variable in your client-side code is being populated by calling getHTTPStatusCodeFromError(error). Make sure that this function returns the correct mapping from the thrown error to its HTTP status code.
Not at my computer right now but I believe that the error is coming through as expected
I’ll check tomorrow and get back here