Log error when brightness change fails
Currently panics and closes the program, for example if there is an permissions error (where i encountered it)
This commit is contained in:
committed by
Kenny Levinsen
parent
1b8c041151
commit
a52bc3f126
+14
-2
@@ -143,7 +143,13 @@ impl ModuleImpl for Backlight {
|
|||||||
y,
|
y,
|
||||||
} => {
|
} => {
|
||||||
self.add(y as f32 / 8.0).unwrap();
|
self.add(y as f32 / 8.0).unwrap();
|
||||||
self.sync().unwrap();
|
match self.sync() {
|
||||||
|
Ok(val) => val,
|
||||||
|
Err(err) => {
|
||||||
|
eprintln!("Error while trying to change brightness: {}", err);
|
||||||
|
()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Input::Click { pos: _pos, button } => {
|
Input::Click { pos: _pos, button } => {
|
||||||
match button {
|
match button {
|
||||||
@@ -154,7 +160,13 @@ impl ModuleImpl for Backlight {
|
|||||||
} else {
|
} else {
|
||||||
1
|
1
|
||||||
};
|
};
|
||||||
self.sync().unwrap();
|
match self.sync() {
|
||||||
|
Ok(val) => val,
|
||||||
|
Err(err) => {
|
||||||
|
eprintln!("Error while trying to change brightness: {}", err);
|
||||||
|
()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user