Skip to main content

Module error

Module error 

Source
Expand description

Unified error types for the perfgate ecosystem.

This module provides a single, comprehensive error type that unifies all error variants from across the perfgate crates. It enables seamless error propagation and conversion between different error types.

Part of the perfgate workspace.

§Error Categories

The PerfgateError enum is organized into categories:

  • Validation: Bench name validation, config validation
  • Stats: Statistical computation errors (no samples)
  • Adapter: Process execution, I/O, platform-specific errors
  • Config: Configuration parsing and validation errors
  • IO: File system and network I/O errors
  • Paired: Paired benchmark errors
  • Auth: Authentication and authorization errors
  • Parse: JSON and TOML deserialization errors

§Example

use perfgate_types::error::{PerfgateError, ValidationError};

fn validate_name(name: &str) -> Result<(), PerfgateError> {
    if name.is_empty() {
        return Err(ValidationError::Empty.into());
    }
    Ok(())
}

let err = validate_name("").unwrap_err();
assert!(matches!(err, PerfgateError::Validation(ValidationError::Empty)));

Enums§

AdapterError
AuthError
ConfigValidationError
ErrorCategory
IoError
PairedError
ParseError
PerfgateError
StatsError
ValidationError

Constants§

BENCH_NAME_MAX_LEN
BENCH_NAME_PATTERN

Functions§

validate_bench_name

Type Aliases§

Result