create serde compatible parse error

This commit is contained in:
Demonthos committed 2022-06-15 12:58:08 -05:00
1 parent 41e905144c
commit df4ea20bb8
9 files changed
+68 -45

No files matched your search

+2 -9
View File
@@ -275,15 +275,8 @@ pub async fn run_with_props<T: 'static + Send>(root: Component<T>, root_props: T
// forward stream to the websocket
dom.base_scope().spawn_forever(async move {
while let Some(err) = error_channel_receiver.next().await {
match err {
Error::RecompileRequiredError(err) => {
ws.send_with_str(serde_json::to_string(&err).unwrap().as_str())
.unwrap();
}
Error::ParseError(err) => {
web_sys::console::warn_1(&wasm_bindgen::JsValue::from_str(&err.to_string()))
}
}
ws.send_with_str(serde_json::to_string(&err).unwrap().as_str())
.unwrap();
}
});
}