Skip to content

to_warmhub_error

Function: warmhub.to_warmhub_error

to_warmhub_error(error: object)

Normalize any thrown value into a WarmHubError.

Branch order is TypeScript’s, and the order is load-bearing: the unwrap of a fetch-layer error out of a tRPC wrapper must precede envelope mapping, or an authored NETWORK error surfaces as a generic BACKEND.

Raises rather than returns for cancellation and interpreter shutdown. See _refuse_to_normalize_cancellation; the transport is not the only caller of this function, and a normalizer that swallows a CancelledError at a generic boundary hangs a TaskGroup exactly as one in the transport would.