aryzingA
tRPC3y ago
1 reply
aryzing

Feature or happy accident: error message from `cause` being used as TRPC's error message

When a procedure throws a TRPC error with no message, it turns out that if the thrown error has a cause, and the cause has a message, the cause's message will be used as the TRPC error message returned to the client. Is this on purpose or an accident? Couldn't find this behavior documented.
Was this page helpful?