Expand description
ComposableError and error context structures Error types and utilities.
This module provides a set of types and utilities for handling errors in a structured and composable way.
§Examples
use error_rail::{ComposableError, ErrorContext};
let err = ComposableError::new("database connection failed")
.with_context(ErrorContext::tag("db"))
.with_context(ErrorContext::location(file!(), line!()))
.set_code(500);
println!("{}", err.error_chain());
// Output: [db] -> main.rs:42 -> database connection failed (code: 500)Re-exports§
pub use composable_error::*;pub use error_context::*;pub use error_pipeline::*;pub use lazy_context::*;
Modules§
- alloc_
type - composable_
error - Composable error type with structured context and error codes.
- error_
context - Rich, structured metadata for error contexts.
- error_
pipeline - lazy_
context - Deferred context generation for performance-critical paths.
Type Aliases§
- Boxed
Composable Error - Boxed
ComposableErrorfor reduced stack size. - Boxed
Composable Result - Result alias with boxed
ComposableErrorfor reduced stack size. - Composable
Result - Result alias that wraps failures in
ComposableError. - Error
Vec - SmallVec-backed collection used for accumulating contexts/errors.