pub enum NCError {
IPAddrParse(AddrParseError),
IOError(Error),
Serialize(Error),
Deserialize(Error),
Bincode(Box<ErrorKind>),
ServerMsgMismatch,
NodeMsgMismatch,
NodeIDMismatch(NodeID, NodeID),
MutexPoison,
Array2DDimensionMismatch((u64, u64), (u64, u64)),
Custom(u32),
}Expand description
This data structure contains all error codes for the server and the nodes.
Variants§
IPAddrParse(AddrParseError)
Parsing the IP address went wrong.
IOError(Error)
Common IO error, usually network related.
Serialize(Error)
Data could not be serialized for sending over the network.
Deserialize(Error)
Data coming from the network could not be deserialized.
Bincode(Box<ErrorKind>)
The bincode crate has its own error.
ServerMsgMismatch
The node expected a specific message from the server but got s.th. totally different.
NodeMsgMismatch
The server expected a specific message from the node but got s.th. totally different.
NodeIDMismatch(NodeID, NodeID)
A different node id was expected. Expected first node id, found second node id.
MutexPoison
Mutex could not be locked or a thread did panic while holding the lock.
Array2DDimensionMismatch((u64, u64), (u64, u64))
An error using the utility data structure Array2D.
Custom(u32)
Custom user defined error. This needs to be replaced in the future with Box<dyn Error> or s.th. similar.
Trait Implementations§
Source§impl Error for NCError
impl Error for NCError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()