arcbox-error 0.1.4

Common error types for ArcBox
Documentation
  • Coverage
  • 100%
    11 out of 11 items documented1 out of 1 items with examples
  • Size
  • Source code size: 10.74 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.44 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 16s Average build duration of successful builds.
  • all releases: 16s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • arcboxlabs/arcbox
    67 3 21
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • AprilNEA

Common error types for ArcBox.

This crate provides unified error types that are shared across multiple ArcBox crates, reducing code duplication and ensuring consistent error handling patterns.

Usage

use arcbox_error::CommonError;

fn example() -> Result<(), CommonError> {
    // Use CommonError for common error scenarios
    Err(CommonError::NotFound("resource".to_string()))
}

Crate-Specific Errors

Each crate can define its own error type that wraps CommonError:

use arcbox_error::CommonError;
use thiserror::Error;

#[derive(Debug, Error)]
pub enum MyError {
    #[error(transparent)]
    Common(#[from] CommonError),

    #[error("my specific error: {0}")]
    Specific(String),
}