TRPCError that has TRPCError as cause
Having some troubles with error handling, specifically, my errors are double-wrapped in a TRPCError.
What I'm doing is basically having a mutation that does:
and then, the onError handler has:
which logs:
onError TRPCError TRPCError
. If I then go further with error.cause.cause.name
, I can see my error.
I already tried to reproduce this in isolation, but in a sandbox, I get:
onError TRPCError Error
, which is what I would expect.
Just wanted to know if anyone has seen something similar; Not sure how this can happen ... thanks4 Replies
hmmmm this is weird
might be related https://github.com/trpc/trpc/pull/4848
GitHub
Setting TRPCError.name to "TRPCError" by dios-david ยท Pull Request ...
๐ฏ Changes
Setting this.name to "TRPCError" in the TRPCError constructor instead of using this.constructor.name.
Background
I ran into an issue with my trpc server where the production bui...
i'll try to push that
try upgrading to
10.38.5
yeah that fixes it. Thank you so much ๐
I'm not quite sure why I couldn't reproduce it in isolation though