1
Fork 0
mirror of https://github.com/RGBCube/superfreq synced 2025-07-28 09:27:44 +00:00

engine: simplify error handling

This commit is contained in:
NotAShelf 2025-05-16 03:06:59 +03:00
parent c1d81b687c
commit 622f4f6f32
No known key found for this signature in database
GPG key ID: 29D95B64378DB4BF

View file

@ -23,14 +23,13 @@ where
match apply_fn() { match apply_fn() {
Ok(_) => Ok(()), Ok(_) => Ok(()),
Err(e) => { Err(e) => {
if matches!(e, ControlError::NotSupported(_)) if matches!(e, ControlError::NotSupported(_)) {
|| matches!(e, ControlError::InvalidValueError(_))
{
warn!( warn!(
"{feature_name} setting is not supported on this system. Skipping {feature_name} configuration." "{feature_name} setting is not supported on this system. Skipping {feature_name} configuration."
); );
Ok(()) Ok(())
} else { } else {
// Propagate all other errors, including InvalidValueError
Err(EngineError::ControlError(e)) Err(EngineError::ControlError(e))
} }
} }