Skip to main content

workers/runtime/wrapHandlerError

@arolariu/website


@arolariu/website / workers/runtime/wrapHandlerError

workers/runtime/wrapHandlerError

Fileoverview

Worker-side handler wrapper that translates thrown values into the __workerError envelope the host's call proxy unwraps.

Remarks

Comlink's default throwTransferHandler only round-trips name, message, and stack; WHATWG HTML §2.7.3 further normalizes Error.name to one of the seven standard names. To preserve the original error's name and message across the structured-clone boundary we throw a plain envelope object instead. The host's buildCallProxy rewraps the envelope as a typed WorkerError whose .cause holds the envelope.

Type Aliases

Functions

// was this page useful?