use thiserror::Error;
#[derive(Debug, Error)]
pub enum TuneError {
#[error("unknown hyperparameter: {0}")]
UnknownParam(String),
#[error("grid search cannot enumerate distribution `{0}`: {1}")]
UngriddableDistribution(String, &'static str),
#[error("grid search exhausted: all {0} combinations have been proposed")]
GridExhausted(usize),
#[error("invalid distribution bounds: {0}")]
InvalidBounds(String),
#[error("type mismatch reading param `{key}`: expected {expected}, got {got}")]
TypeMismatch {
key: String,
expected: &'static str,
got: String,
},
#[error("journal I/O: {0}")]
Io(#[from] std::io::Error),
#[error("journal serde: {0}")]
Serde(#[from] serde_json::Error),
#[error("evaluator failed: {0}")]
Evaluator(String),
}