mirror of
https://github.com/uqbar-dao/nectar.git
synced 2024-12-23 08:32:23 +03:00
m hint added
This commit is contained in:
parent
a002acff61
commit
ee5e5f009e
@ -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",
|
||||
}
|
||||
);
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user