diff --git a/src/main.rs b/src/main.rs index 8c717af..7c996a8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -464,15 +464,13 @@ fn init_logger() { fn validate_freq(freq_mhz: u32, label: &str) -> Result<(), AppError> { if freq_mhz == 0 { error!("{label} frequency cannot be zero"); - let err = ControlError::InvalidValueError(format!("{label} frequency cannot be zero")); - Err(err.into()) + Err(AppError::Generic(format!("{label} frequency cannot be zero"))) } else if freq_mhz > 10000 { // Extremely high value unlikely to be valid error!("{label} frequency ({freq_mhz} MHz) is unreasonably high"); - let err = ControlError::InvalidValueError(format!( + Err(AppError::Generic(format!( "{label} frequency ({freq_mhz} MHz) is unreasonably high" - )); - Err(err.into()) + ))) } else { Ok(()) }