Skip to main content

blr_active/
error.rs

1use blr_core::BLRError;
2use thiserror::Error;
3
4/// Errors that can arise during active learning operations.
5#[derive(Error, Debug)]
6pub enum ALError {
7    /// Propagated from a BLR fitting failure.
8    #[error("BLR fitting error: {0}")]
9    BlrError(#[from] BLRError),
10
11    /// The requested precision goal is unachievable given the noise floor.
12    #[error("Precision goal unreachable: {0}")]
13    GoalUnreachable(String),
14
15    /// Noise floor has been hit; further measurements unlikely to help.
16    #[error("Noise floor detected — hardware noise is the limiting factor")]
17    NoiseFloorDetected,
18
19    /// The maximum number of active learning iterations was reached.
20    #[error("Maximum iterations reached without convergence")]
21    MaxIterationsReached,
22
23    /// A calibration goal was not set before calling an operation that requires it.
24    #[error("No precision goal set — call set_goal() first")]
25    NoGoalSet,
26}
27
28/// Convenience alias for `Result<T, ALError>`.
29pub type ALResult<T> = Result<T, ALError>;