avx-error
Unified error handling system for the avx ecosystem.
Features
Features
- Zero Dependencies - Pure Rust (except derive macros)
- Rich Error Context - Chain context information
- Error Categories - 15+ predefined error kinds
- Derive Macros - Automatic trait implementations
- no_std Compatible - Works in embedded environments
- Backtrace Support - Optional std backtrace integration
- Type-Safe - Compile-time error handling
Error Kinds
InvalidInput- Bad input dataNotFound- Resource missingPermissionDenied- Access deniedConnectionFailed- Network errorTimeout- Operation timeoutDataCorruption- Corrupted dataConfigError- Configuration issueAuthenticationFailed- Auth failureAuthorizationFailed- Permission failureAlreadyExists- Duplicate resourceResourceExhausted- Out of resourcesCancelled- Operation cancelledInternal- Internal errorNotImplemented- Feature not implementedUnavailable- Service unavailableUnknown- Unknown error
Examples
Basic Usage
use ;
Error Context
use ;
Custom Errors with Derive
use Error as avxError;
Error Matching
use ;
match error.kind
Installation
Add to your Cargo.toml:
[]
= "0.3.0"
With derive macros:
[]
= { = "0.3.0", = ["derive"] }
For no_std environments:
[]
= { = "0.3.0", = false }
Integration
All avx crates use avx-error as the foundation:
// In avx-db
pub type Result<T> = Result;
// In avx-http
License
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE)
- MIT license (LICENSE-MIT)
at your option.