perfgate-error
Shared error types and categorization across the perfgate workspace.
Part of the perfgate workspace.
Problem
A workspace with 26 crates needs a single error vocabulary so that errors flow cleanly from inner layers (stats, adapters) through orchestration to the CLI exit code. This crate defines that vocabulary.
Error Categories
| Category | Type | Typical Cause |
|---|---|---|
| Validation | ValidationError |
Invalid bench name, bad characters, path traversal |
| Stats | StatsError |
No samples to summarize |
| Adapter | AdapterError |
Spawn failure, timeout, unsupported platform |
| Config | ConfigValidationError |
Bad config file, invalid bench reference |
| IO | IoError |
Missing baseline file, artifact write failure |
| Paired | PairedError |
Paired benchmark with no samples |
| Auth | AuthError |
Missing/expired key, insufficient permissions |
All variants unify under PerfgateError with From impls for seamless ?
propagation. Every error maps to exit code 1 (vs policy-fail 2 / warn 3).
Key API
PerfgateError-- unified enum wrapping all category-specific errorsErrorCategory-- classification enum for routing and diagnosticsis_recoverable()-- true for transient failures (I/O, timeouts)exit_code()-- always1for tool/runtime errorsvalidate_bench_name(name)-- bench name validationResult<T>-- type alias forstd::result::Result<T, PerfgateError>
Example
use ;
let err = validate_bench_name.unwrap_err;
let unified: PerfgateError = err.into;
assert_eq!;
assert!;
License
Licensed under either Apache-2.0 or MIT.