1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-30 05:10:03 -04:00

egui_web: log panics using console.error

This commit is contained in:
Emil Ernerfeldt
2022-01-31 19:14:50 +01:00
parent 532990d3dd
commit ef81a52951
4 changed files with 27 additions and 11 deletions

View File

@@ -281,6 +281,9 @@ impl AppRunner {
/// Install event listeners to register different input events
/// and start running the given app.
pub fn start(canvas_id: &str, app: Box<dyn epi::App>) -> Result<AppRunnerRef, JsValue> {
// Make sure panics are logged using `console.error`.
console_error_panic_hook::set_once();
let mut runner = AppRunner::new(canvas_id, app)?;
runner.warm_up()?;
start_runner(runner)