Skip to content

Alternate and debug display formats #9

Description

@MihaiStreames

Context

Rust's anyhow::Error supports multiple display formats:

  • {}: outermost context only
  • {:#}: colon-joined full chain: "g failed: f failed: oh no!"
  • {:?}: structured debug with "Caused by:" section

Our Failure::fmt() always renders newline-separated outermost-first. This issue tracks adding the alternate formats.

Proposed API

failure.fmt()         // existing: newline-separated, outermost first (matches current behaviour)
failure.fmt_inline()  // new: colon-joined chain, e.g. "outer: middle: root [domain]"
failure.fmt_debug()   // new: structured with "Caused by:" indented block

No operator<< overload changes needed -- callers pick the method explicitly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions