You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(cache): print the full cause chain in CacheError::Store and Internal Display #2269
area:nodedecdn-node daemon: runtime, handlers, admin RPC, serve pathkind:bugSomething does not behave as documentedprio:lowWhen convenientrustDependabot: a Cargo update; use area: labels for Rust code otherwise
CacheError::Store and CacheError::Internal (crates/cache/src/error.rs) keep the cause as #[source] anyhow::Error, but their Display is #[error("store error: {0}")] / #[error("internal fault: {0}")]. Plain {0} on an anyhow::Error prints only the outermost message, so every log site that records the error with error = %err (the cache crate's idiom) drops the iroh-blobs causes underneath. {err:#} at the log site does not help: CacheError is a thiserror enum, and the alternate flag does not reach the inner {0}.
Same class of defect as #2251 (error chain lost via to_string()), on the cache side.
Fix
Use anyhow's alternate format inside the Display so the whole chain prints on one line:
One-line change per variant; every existing %err WARN gets the chain with no call-site churn. Keep #[source] so programmatic source() / chain() walks still work.
Trade-off
A consumer that prints both the message and the source list (e.g. tracing-subscriber's record_errorsources=[…], or code walking chain() and joining) would show the causes twice. A grep found no such consumer for CacheError today and no test asserting on the store error: / internal fault: text.
Acceptance
A test that builds CacheError::Store(anyhow::anyhow!("root").context("outer")) and asserts its to_string() contains both outer and root; same for Internal.
cargo nextest run -p decdn-cache, clippy --all-targets, and cargo doc -D warnings clean.
area:nodedecdn-node daemon: runtime, handlers, admin RPC, serve pathkind:bugSomething does not behave as documentedprio:lowWhen convenientrustDependabot: a Cargo update; use area: labels for Rust code otherwise
Activity