ProtectedflattenOptionalcancellationToken: CancellationTokenProtectedrequestCalls the backend model and flattens any thrown error's cause chain into its message.
This is the single choke point where backend errors are still complete: the RPC error
extension that serializes this rejection to the frontend only keeps code, data, message,
name and stack, dropping cause. Node's fetch (undici) reports network failures as an
opaque TypeError: fetch failed with the actionable reason (ECONNREFUSED, ENOTFOUND, TLS
errors, ...) on error.cause, so without flattening here the frontend would only ever see
"fetch failed". Flattening the chain into the message preserves the real reason across RPC.
OptionalcancellationToken: CancellationTokenProtectedsendOptionalcancellationToken: CancellationToken
Builds an Error whose message incorporates the
causechain (see requestAndFlattenErrors), while preserving the original stack and name. Non-error inputs are returned unchanged.