Skip to main content

set_error_forwarder

Function set_error_forwarder 

Source
pub fn set_error_forwarder(forwarder: fn(&str))
Expand description

Installs a process-wide forwarder for internal-error diagnostics (architecture section 11).

On wasm32 a tracing dispatcher cannot be installed — it hangs the workerd/miniflare isolate — so every tracing::error! core emits when it maps an internal failure to a 500 is dropped, and a Workers 500 becomes a black box (issue #107). The Cloudflare runtime therefore points this forwarder at worker::console_error!, and core calls it alongside its tracing::error! so the same one-line diagnostic reaches Workers Logs.

Native runs leave it unset and rely on the tracing subscriber. This is boot-time infrastructure installed before the first response, not request state (ADR 0007); the first installation wins and later calls are ignored.