macro_rules! backtrace {
() => { ... };
}Expand description
Captures the current backtrace as lazy error context.
This macro creates a LazyContext that captures the stack
backtrace only when the error actually occurs, avoiding the performance overhead of
backtrace generation on the success path.
The backtrace is captured using std::backtrace::Backtrace::capture() and converted
to a string representation when the context is evaluated.
ยงExamples
use error_rail::{ComposableError, backtrace};
let err = ComposableError::<&str>::new("panic occurred")
.with_context(backtrace!());