Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
accessibility/wl-gammarelay-rs: apply a crashfix
thread 'main' panicked at rustbus-service-7401913977ccf665748b1f4dee033921e1c86afd/src/lib.rs:117:39: not yet implemented
- Loading branch information
Showing
2 changed files
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
accessibility/wl-gammarelay-rs/files/patch-rustbus-service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
https://github.com/MaxVerevkin/wl-gammarelay-rs/issues/22 | ||
https://github.com/MaxVerevkin/rustbus-service/commit/681b783ff093 | ||
|
||
--- ../rustbus-service-7401913977ccf665748b1f4dee033921e1c86afd/src/lib.rs.orig 2024-03-17 08:14:31 UTC | ||
+++ ../rustbus-service-7401913977ccf665748b1f4dee033921e1c86afd/src/lib.rs | ||
@@ -114,7 +114,14 @@ impl<D: 'static> Service<D> { | ||
MessageType::Signal => { | ||
eprintln!("todo: handle signal: {:?}", msg.dynheader.member); | ||
} | ||
- MessageType::Error => todo!(), | ||
+ MessageType::Error => { | ||
+ let error_name = msg.dynheader.error_name.expect("error without error_name"); | ||
+ let error_message = msg.body.parser().get::<&str>().ok(); | ||
+ eprintln!( | ||
+ "dbus error: {error_name}: {}", | ||
+ error_message.unwrap_or("<no message>") | ||
+ ); | ||
+ } | ||
MessageType::Call => { | ||
if let Some(cb) = get_call_handler(&self.root, &msg) { | ||
cb(MethodContext { |