| Crates.io | avx-error |
| lib.rs | avx-error |
| version | 0.2.0 |
| created_at | 2025-12-17 02:30:41.008057+00 |
| updated_at | 2025-12-17 02:30:41.008057+00 |
| description | AVL Platform error handling - replacement for anyhow/thiserror |
| homepage | https://avila.inc |
| repository | https://github.com/avilaops/arxis |
| max_upload_size | |
| id | 1989188 |
| size | 16,385 |
Unified error handling system for the avx ecosystem.
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 erroruse avx_error::{Error, ErrorKind, Result};
fn load_config(path: &str) -> Result<Config> {
if path.is_empty() {
return Err(Error::new(
ErrorKind::InvalidInput,
"Path cannot be empty"
));
}
// ...
Ok(Config::default())
}
use avx_error::{Result, ResultExt};
fn parse_file(path: &str) -> Result<Data> {
read_file(path)
.context("Failed to read file")?;
parse_json(contents)
.with_context(|| format!("Failed to parse {}", path))?;
Ok(data)
}
use avx_error::Error as avxError;
#[derive(Debug, avxError)]
enum MyError {
IoError(std::io::Error),
ParseError(String),
Custom { code: i32, message: String },
}
use avx_error::{Error, ErrorKind};
match error.kind() {
ErrorKind::NotFound => {
// Handle missing resource
},
ErrorKind::PermissionDenied => {
// Handle access denied
},
_ => {
// Handle other errors
}
}
Add to your Cargo.toml:
[dependencies]
avx-error = "0.3.0"
With derive macros:
[dependencies]
avx-error = { version = "0.3.0", features = ["derive"] }
For no_std environments:
[dependencies]
avx-error = { version = "0.3.0", default-features = false }
All avx crates use avx-error as the foundation:
// In avx-db
pub type Result<T> = avx_error::Result<T>;
// In avx-http
impl From<HttpError> for avx_error::Error {
fn from(err: HttpError) -> Self {
// Convert to avx_error::Error
}
}
Licensed under either of:
at your option.