Expand description
Error handling library with context attachment and ergonomic macros.
This library provides a unified error type that wraps any Error + Send + Sync,
a trait for attaching context messages to failures, and macros for convenient
error creation and early return.
§Key Types
Error- Main error type that wraps dynamic errors.Context- Trait for adding context to errors.Result- Type alias forResult<T, Error>.
§Macros
Macros§
- bail
- Return early with an error from the current function.
- ensure
- Bail if a condition is false.
- toobad
- Create an error from a formatted message.
Structs§
- Error
- Unified error type that wraps any
Error + Send + Sync.
Traits§
- Context
- Trait for attaching context to errors.