klauthed-error
The zero-dependency error kernel for the klauthed crates. It owns only the shared contract — not concrete error types.
ErrorCategory—BadRequest/Unauthorized/Forbidden/NotFound/Conflict/RateLimited/Timeout/Unavailable/Internal, withhttp_status()andis_retryable().ErrorCode— a newtype overCow<'static, str>following thedomain.reasonconvention (e.g.security.expired_token).DomainError— the trait every crate's error type implements:category()+code(), withhttp_status()/is_retryable()defaulted from the category.
Concrete error enums live in their own crates (e.g. ConfigError in klauthed-core,
SecurityError in klauthed-security) and impl DomainError — usually generated by
#[derive(DomainError)] from klauthed-macros. An optional
serde feature derives Serialize/Deserialize for the shared types.
Part of the klauthed rust-libraries workspace.
Browse the API: cargo doc -p klauthed-error --open.
License
Dual-licensed under MIT or Apache-2.0, at your option.