orion-error 0.8.0

Struct Error for Large Project
Documentation
use super::{DomainReason, StructError};

/// Print an error with its full source chain to stderr.
///
/// This is a convenience wrapper around [`StructError::display_chain()`]
/// intended for binary/CLI entry points.
///
/// # Example
///
/// ```rust
/// use orion_error::{cli::print_error, StructError, UnifiedReason};
///
/// let err = StructError::from(UnifiedReason::system_error())
///     .with_detail("config not found");
/// print_error(&err);
/// ```
pub fn print_error<R>(err: &StructError<R>)
where
    R: DomainReason,
{
    eprintln!("{}", err.display_chain());
}