ubisync/ubisync-sdk/src/error.rs

21 lines
549 B
Rust
Raw Normal View History

use std::fmt::Display;
#[derive(Debug)]
pub enum UbisyncError {
InvalidNodeReply(String),
AppRegistrationFailed,
}
impl Display for UbisyncError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Self::InvalidNodeReply(msg) => write!(f, "Invalid reply from ubisync node: {}", msg),
2024-01-07 22:28:09 +01:00
Self::AppRegistrationFailed => {
write!(f, "Registrating this app at the ubisync node failed.")
}
}
}
}
2024-01-07 22:28:09 +01:00
impl std::error::Error for UbisyncError {}