daemon: preserve full anyhow context chain in IPC error replies
e.to_string() on an anyhow::Error only prints the outermost .context()
message; the underlying cause (why connect_app/build_pipeline/etc.
actually failed) was being silently dropped before it ever reached the
GUI or bread event log. Use "{e:#}" instead.
This commit is contained in:
parent
5b49955e33
commit
14274856a3
1 changed files with 7 additions and 4 deletions
|
|
@ -163,8 +163,11 @@ impl Daemon {
|
||||||
let _ = reply.send(Ok(()));
|
let _ = reply.send(Ok(()));
|
||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
bread_events::emit_mirroring_failed(&self.bread_client, &device.id, &e.to_string());
|
// `{e:#}` (not `{e}`/`to_string()`) so the full anyhow
|
||||||
let _ = reply.send(Err(e.to_string()));
|
// context chain reaches the caller/GUI instead of just
|
||||||
|
// the outermost ".context()" message.
|
||||||
|
bread_events::emit_mirroring_failed(&self.bread_client, &device.id, &format!("{e:#}"));
|
||||||
|
let _ = reply.send(Err(format!("{e:#}")));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|
@ -184,8 +187,8 @@ impl Daemon {
|
||||||
let _ = reply.send(Ok(()));
|
let _ = reply.send(Ok(()));
|
||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
bread_events::emit_mirroring_failed(&self.bread_client, &device.url, &e.to_string());
|
bread_events::emit_mirroring_failed(&self.bread_client, &device.url, &format!("{e:#}"));
|
||||||
let _ = reply.send(Err(e.to_string()));
|
let _ = reply.send(Err(format!("{e:#}")));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue