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:
I already tried to reproduce this in isolation, but in a sandbox, I get:
Just wanted to know if anyone has seen something similar; Not sure how this can happen ... thanks
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 ... thanks