diff --git a/hemx-js/runtime/hemx.js b/hemx-js/runtime/hemx.js index fcee9f0..4391c01 100644 --- a/hemx-js/runtime/hemx.js +++ b/hemx-js/runtime/hemx.js @@ -793,10 +793,18 @@ roots().forEach((root) => { try { bootstrapState(root); + } catch (error) { + emit(root, "hemx:state-error", String(error)); + } + try { bindRoot(root); + } catch (error) { + emit(root, "hemx:bind-error", String(error)); + } + try { bindSse(root); } catch (error) { - emit(root, "hemx:error", String(error)); + emit(root, "hemx:sse-error", String(error)); } }); try { diff --git a/hemx-js/tests/runtime.rs b/hemx-js/tests/runtime.rs index 5ef2a9d..b97aff6 100644 --- a/hemx-js/tests/runtime.rs +++ b/hemx-js/tests/runtime.rs @@ -11,7 +11,9 @@ fn runtime_exposes_debug_api_before_startup_side_effects() { .expect("runtime starts after declaration"); assert!(api < start); assert!(source.contains("try {\n bootstrapState(root);")); - assert!(source.contains("emit(root, \"hemx:error\", String(error));")); + assert!(source.contains("emit(root, \"hemx:state-error\", String(error));")); + assert!(source.contains("try {\n bindRoot(root);")); + assert!(source.contains("emit(root, \"hemx:bind-error\", String(error));")); } #[test]