From 923e33a2b44586164011a26131d73e563f3d1084 Mon Sep 17 00:00:00 2001 From: Simon Fondrie-Teitler Date: Mon, 15 Jan 2024 22:21:23 -0500 Subject: [PATCH] console_error_panic_hook at the disco --- Cargo.lock | 11 +++++++++++ meatweb/Cargo.toml | 1 + meatweb/src/main.rs | 3 ++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 6f596d1..97b18bb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -498,6 +498,16 @@ dependencies = [ "toml", ] +[[package]] +name = "console_error_panic_hook" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc" +dependencies = [ + "cfg-if", + "wasm-bindgen", +] + [[package]] name = "const_format" version = "0.2.32" @@ -1776,6 +1786,7 @@ version = "0.1.0" dependencies = [ "charming", "chrono", + "console_error_panic_hook", "deku", "gloo", "itertools 0.12.0", diff --git a/meatweb/Cargo.toml b/meatweb/Cargo.toml index f18a25f..e7493f5 100644 --- a/meatweb/Cargo.toml +++ b/meatweb/Cargo.toml @@ -20,6 +20,7 @@ itertools = "0.12.0" gloo = { version = "0.11.0", features = ["timers"]} charming = { version = "0.3.1", features = ["wasm"] } chrono = "0.4.31" +console_error_panic_hook = "0.1.7" [dependencies.web-sys] version = "0.3.66" diff --git a/meatweb/src/main.rs b/meatweb/src/main.rs index f2e1e98..c749f51 100644 --- a/meatweb/src/main.rs +++ b/meatweb/src/main.rs @@ -2,7 +2,7 @@ mod bluetooth; mod chart; mod history; -use std::collections::BTreeMap; +use std::{collections::BTreeMap, panic}; use bluetooth::{get_characteristics_and_listeners_from_service, show_connected, ConnectionState}; use history::LogItem; @@ -138,5 +138,6 @@ fn App() -> impl IntoView { } fn main() { + panic::set_hook(Box::new(console_error_panic_hook::hook)); leptos::mount_to_body(|| view! { }) }