console_error_panic_hookThis crate lets you debug panics on wasm32-unknown-unknown by providing a
panic hook that forwards panic messages to
console.error.
When an error is reported with console.error, browser devtools and node.js
will typically capture a stack trace and display it with the logged error
message.
Without console_error_panic_hook you just get something like RuntimeError: Unreachable executed

With this panic hook installed you will see the panic message

There are two ways to install this panic hook.
First, you can set the hook yourself by calling std::panic::set_hook in
some initialization function:
```rust extern crate consoleerrorpanic_hook; use std::panic;
fn myinitfunction() { panic::sethook(Box::new(consoleerrorpanichook::hook));
// ...
} ```
Alternatively, use set_once on some common code path to ensure that
set_hook is called, but only the one time. Under the hood, this uses
std::sync::Once.
```rust extern crate consoleerrorpanic_hook;
struct MyBigThing;
impl MyBigThing { pub fn new() -> MyBigThing { consoleerrorpanichook::setonce();
MyBigThing
}
} ```