Skip to main content

set_panic_hook

Function set_panic_hook 

Source
pub fn set_panic_hook()
Expand description

Routes Rust panics to console.error with a readable message and stack.

A panic in wasm otherwise surfaces as a bare RuntimeError: unreachable, which says nothing about what went wrong. Call this once at startup while debugging; it is not needed in production.