Skip to content

Commit

Permalink
Implemented std::error::Error for ReachabilityError.
Browse files Browse the repository at this point in the history
  • Loading branch information
mstyura committed Sep 18, 2024
1 parent c7a1626 commit dc513a4
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions system-configuration/src/network_reachability.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,19 @@ pub enum ReachabilityError {
UnrecognizedFlags(u32),
}

impl Display for ReachabilityError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Self::FailedToDetermineReachability => write!(f, "Failed to determine reachability"),
Self::UnrecognizedFlags(flags) => {
write!(f, "Unrecognized reachability flags: {}", flags)
}
}
}
}

impl Error for ReachabilityError {}

/// Failure to schedule a reachability callback on a runloop.
#[derive(Debug)]
pub struct SchedulingError(());
Expand Down

0 comments on commit dc513a4

Please sign in to comment.