slight error log fix

This commit is contained in:
2024-11-08 15:18:53 -07:00
parent 4e42cb9893
commit 542d51c42f
3 changed files with 6 additions and 4 deletions
+4 -4
View File
@@ -354,15 +354,16 @@ pub async fn network_entrypoint(mut event_rx: UnboundedReceiver<Command>) {
};
if let Err(error) = network_connect(address, username, &mut event_rx).await {
*STATE.status.write() = ConnectionState::Failed(format!("{error:?}"));
console::error_1(&error);
let text = js_sys::Object::from(error).to_string().into();
*STATE.status.write() = ConnectionState::Failed(text);
}
}
}
macro_rules! bail {
($($x:tt)*) => {
return Err(wasm_bindgen::JsError::new(&format!($($x)*)).into());
return Err(wasm_bindgen::JsError::new(&format!($($x)*)).into())
};
}
@@ -413,8 +414,7 @@ async fn network_connect(
console::log_1(&transport.clone().into());
if let Err(e) = wasm_bindgen_futures::JsFuture::from(transport.ready()).await {
console::log_1(&e.into());
panic!();
bail!("could not connect to transport: {e:?}");
}
console::log_1(&"Transport is ready.".into());