rustbus
rustbus copied to clipboard
`rustbus::client_conn::Error` doesn't implement `std::error::Error`
This prevents generalized error handling. e.g. w/ anyhow:
fn connect_sys() -> anyhow::Result<rustbus::Conn> {
let sys_path = get_system_bus_path()?;
rustbus::Conn::connect_to_bus(sys_path, true)
}
fn main() {
let _ = match connect_sys() {
Ok(_) => {},
Err(e) => println!("error={}", &e),
}
}
Hey,
This is an issue I intend to work on in the future. I was going to look into the available crates that make error handling more ergonomic. The current *Error enums have grown as I was writing the library. Currently there is a relatively big part being written in dispatch_conn branch, which I am focussing on at the moment. Making errors better is definitely on the roadmap though.
Understood. For now, I'm working around by manually formatting rustbus error into an anyhow error. I'll update once rustbus gets updated. Thank you so much.
I don't know why I did not update this issue, but I got around to doing this quite a while ago in commit 58144f68bc05fe881eeda20cdb9e6cb9ef0bd1f0 so...
Maybe hold off from updating quite yet, I'll make a new release with the commits from today