Skip to main content

workers/runtime/installUnhandledRejectionBridge

@arolariu/website


@arolariu/website / workers/runtime/installUnhandledRejectionBridge

workers/runtime/installUnhandledRejectionBridge

Fileoverview

Forward worker-side unhandledrejection events to the parent over the side-channel event port as a {kind: "log", level: "error"} event.

Remarks

Without this bridge a rejected promise inside a handler (e.g. a forgotten await) silently disappears — the worker keeps running, the parent sees nothing, and the bug only surfaces if the user reads the worker's console. Forwarding the rejection as a structured log event surfaces it through the parent's existing logger seam (telemetryBridge.ingestEvent).

NOTE: This is diagnostic, not a crash signal. The host does NOT transition to dead on an unhandled rejection — the worker keeps running. If the rejection signals real corruption, callers should explicitly call host.restart() after observing the log line.

Functions

// was this page useful?