format_error_chain

Function format_error_chain 

Source
pub fn format_error_chain<E>(error: &ComposableError<E>) -> String
where E: Display,
Expand description

Formats a ComposableError as a human-readable error chain.

Returns a string representation showing all contexts and the core error.

§Arguments

  • error - The composable error to format

§Examples

use error_rail::{ComposableError, ErrorContext, format_error_chain};

let err = ComposableError::new("failed")
    .with_context(ErrorContext::tag("db"));
let chain = format_error_chain(&err);
assert!(chain.contains("failed"));