pub fn with_context<E, C>(error: E, context: C) -> ComposableError<E>where
C: IntoErrorContext,Expand description
Wraps an error with a single context entry.
Creates a new ComposableError containing the given error and context.
§Arguments
error- The core error to wrapcontext- Context information to attach
§Examples
use error_rail::{with_context, ErrorContext};
let err = with_context("io failed", ErrorContext::tag("disk"));
assert_eq!(err.context().len(), 1);