Add Error kinds

This commit is contained in:
Matthias Beyer 2016-02-03 19:59:01 +01:00
parent 17daf7c387
commit e6e9a1a19e

View file

@ -6,11 +6,21 @@ use std::fmt;
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum LinkErrorKind {
EntryHeaderReadError,
EntryHeaderWriteError,
ExistingLinkTypeWrong,
}
fn link_error_type_as_str(e: &LinkErrorKind) -> &'static str {
match e {
_ => unimplemented!(),
&LinkErrorKind::EntryHeaderReadError
=> "Error while reading an entry header",
&LinkErrorKind::EntryHeaderWriteError
=> "Error while writing an entry header",
&LinkErrorKind::ExistingLinkTypeWrong
=> "Existing link entry has wrong type",
}
}