diff --git a/kinode/packages/terminal/m/src/lib.rs b/kinode/packages/terminal/m/src/lib.rs index 112c030d..8bf3157c 100644 --- a/kinode/packages/terminal/m/src/lib.rs +++ b/kinode/packages/terminal/m/src/lib.rs @@ -80,14 +80,22 @@ fn init(_our: Address) { println!("m: awaiting response for {}s", s); match req.send_and_await_response(*s).unwrap() { Ok(res) => { - let _ = Response::new().body(res.body()).send(); + // TODO piping is broken. Patching it by just printing the response + // let _ = Response::new().body(res.body()).send(); + if let Ok(txt) = std::str::from_utf8(&res.body()) { + println!("{txt}"); + } else { + println!("{:?}", res.body()); + } } Err(e) => { println!( - "m: failed to send message {}", + "m: {}", match e.kind { - SendErrorKind::Timeout => "due to timeout", - SendErrorKind::Offline => "because the target is offline", + SendErrorKind::Timeout => + "target did not send Response in time, try increasing the await time", + SendErrorKind::Offline => + "failed to send message because the target is offline", } ); } diff --git a/kinode/src/kernel/mod.rs b/kinode/src/kernel/mod.rs index 4b1638aa..d39856c9 100644 --- a/kinode/src/kernel/mod.rs +++ b/kinode/src/kernel/mod.rs @@ -981,12 +981,17 @@ pub async fn kernel( .send(t::Printout { verbosity: 0, content: format!( - "event loop: got {} from network for {}, but process does not exist (perhaps it terminated)", + "event loop: got {} from network for {}, but process does not exist{}", match kernel_message.message { t::Message::Request(_) => "Request", t::Message::Response(_) => "Response", }, kernel_message.target.process, + match kernel_message.message { + t::Message::Request(_) => "", + t::Message::Response(_) => + "\nhint: if you are using `m`, try awaiting the Response: `m --await 5 ...`", + } ) }) .await;