Throw `Error` objects, not strings, so you keep a stack trace. Subclass `Error` for domain failures and use `{ cause }` to keep the original.
class RpcError extends Error {
constructor(message, options) { super(message, options); this.name = "RpcError"; }
}
throw new RpcError("call failed", { cause: err });Never swallow an error silently — log it or rethrow, otherwise debugging a failed transaction becomes guesswork.