T
tRPC

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

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

Aaryzing11/1/2023
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.

Looking for more? Join the community!

T
tRPC

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

Join Server