console_error_panic_hook icon indicating copy to clipboard operation
console_error_panic_hook copied to clipboard

Display panic error messages in web UI

Open ivan-aksamentov opened this issue 2 years ago • 1 comments

Motivation

Currently panics are printed to the dev console. However, the errors are not manifesting in the web UI. It is not a great user experience.

I understand that the goal of the crate is to print to console, however I am looking for ways to pass the panic info from panic hook into my web application. I run a WebAssembly module in a WebWorker. What are my options?

Is there a way to emit a DOM event from the panic handler somehow and use e.g. AddEventListener() to subscribe to it?

What are the options for a WebAssembly module running in a WebWorker? (it does not have window and some of the other functionality compared to the main thread).

I am using React for UI, Recoil for state handling, and Observable for events.

Any thoughts or ideas?

Proposed Solution

I am looking for possible solutions yet.

Alternatives

I am looking for possible alternatives yet.

Additional Context

N/A

ivan-aksamentov avatar Nov 03 '23 20:11 ivan-aksamentov