Skip to content

Commit

Permalink
can: Add Other error kind
Browse files Browse the repository at this point in the history
  • Loading branch information
timokroeger committed Oct 20, 2021
1 parent 402f1cf commit 6a6ad3f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/can/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ pub enum ErrorKind {
/// An ACK error shall be detected by a transmitter whenever it does not
/// monitor a dominant bit during the ACK slot.
Ack,

/// A different error occurred. The original error may contain more information.
Other,
}

impl Error for ErrorKind {
Expand All @@ -110,6 +113,10 @@ impl core::fmt::Display for ErrorKind {
"A fixed-form bit field contains one or more illegal bits"
),
Self::Ack => write!(f, "Transmitted frame was not acknowledged"),
Self::Other => write!(
f,
"A different error occurred. The original error may contain more information"
),
}
}
}

0 comments on commit 6a6ad3f

Please sign in to comment.