From 14274856a388b1b23ad7bbd97e5139d7add6ce5b Mon Sep 17 00:00:00 2001 From: Breadway Date: Wed, 5 Aug 2026 19:14:58 +0800 Subject: [PATCH] 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. --- breadcastd/src/daemon.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/breadcastd/src/daemon.rs b/breadcastd/src/daemon.rs index dbb3f21..1a09b64 100644 --- a/breadcastd/src/daemon.rs +++ b/breadcastd/src/daemon.rs @@ -163,8 +163,11 @@ impl Daemon { let _ = reply.send(Ok(())); } Err(e) => { - bread_events::emit_mirroring_failed(&self.bread_client, &device.id, &e.to_string()); - let _ = reply.send(Err(e.to_string())); + // `{e:#}` (not `{e}`/`to_string()`) so the full anyhow + // 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; @@ -184,8 +187,8 @@ impl Daemon { let _ = reply.send(Ok(())); } Err(e) => { - bread_events::emit_mirroring_failed(&self.bread_client, &device.url, &e.to_string()); - let _ = reply.send(Err(e.to_string())); + bread_events::emit_mirroring_failed(&self.bread_client, &device.url, &format!("{e:#}")); + let _ = reply.send(Err(format!("{e:#}"))); } } return;