add some error managment
This commit is contained in:
parent
53a30fad23
commit
bda74f55ac
5 changed files with 70 additions and 10 deletions
|
|
@ -27,11 +27,11 @@ impl<T: Read + Seek> ReadSeek for T {}
|
|||
impl std::fmt::Display for Error {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
|
||||
match self {
|
||||
Self::InputTooSmall(msg) => write!(f, "Error: {}", msg),
|
||||
Self::SerializationError(msg) => write!(f, "Error: {}", msg),
|
||||
Self::DeserializationError(msg) => write!(f, "Error: {}", msg),
|
||||
Self::InvalidStringEncoding(msg) => write!(f, "Error: {}", msg),
|
||||
Self::InconsistantStruct(msg) => write!(f, "Error: {}", msg),
|
||||
Self::InputTooSmall(msg) => write!(f, "{}", msg),
|
||||
Self::SerializationError(msg) => write!(f, "{}", msg),
|
||||
Self::DeserializationError(msg) => write!(f, "{}", msg),
|
||||
Self::InvalidStringEncoding(msg) => write!(f, "{}", msg),
|
||||
Self::InconsistantStruct(msg) => write!(f, "{}", msg),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue