i am throwing a TRPCError in a mutation. i dont understand how to catch this error in the OnError method. Please help me with this.
i have the following:
ServerSide
throw new TRPCError({ message: 'Password changed too recently', code: 'BAD_REQUEST', cause: Error("You can only modify your password once a day", { cause: 'VALIDATION_ERROR' }), });
throw new TRPCError({ message: 'Password changed too recently', code: 'BAD_REQUEST', cause: Error("You can only modify your password once a day", { cause: 'VALIDATION_ERROR' }), });