mirror of
https://gitlab.steamos.cloud/holo/steamos-manager.git
synced 2025-07-12 09:22:26 -04:00
error: Split out error utils into a separate module
This commit is contained in:
parent
f4247de8c1
commit
fd500229d6
5 changed files with 29 additions and 18 deletions
16
src/lib.rs
16
src/lib.rs
|
@ -17,6 +17,7 @@ use tracing::{info, warn};
|
|||
mod cec;
|
||||
mod daemon;
|
||||
mod ds_inhibit;
|
||||
mod error;
|
||||
mod hardware;
|
||||
mod manager;
|
||||
mod power;
|
||||
|
@ -135,21 +136,6 @@ async fn reload() -> Result<()> {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn to_zbus_fdo_error<S: ToString>(error: S) -> zbus::fdo::Error {
|
||||
zbus::fdo::Error::Failed(error.to_string())
|
||||
}
|
||||
|
||||
pub fn to_zbus_error<S: ToString>(error: S) -> zbus::Error {
|
||||
zbus::Error::Failure(error.to_string())
|
||||
}
|
||||
|
||||
pub fn zbus_to_zbus_fdo(error: zbus::Error) -> zbus::fdo::Error {
|
||||
match error {
|
||||
zbus::Error::FDO(error) => *error,
|
||||
error => zbus::fdo::Error::Failed(error.to_string()),
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use crate::testing;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue