Add Error kinds
This commit is contained in:
parent
17daf7c387
commit
e6e9a1a19e
1 changed files with 11 additions and 1 deletions
|
@ -6,11 +6,21 @@ use std::fmt;
|
||||||
|
|
||||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||||
pub enum LinkErrorKind {
|
pub enum LinkErrorKind {
|
||||||
|
EntryHeaderReadError,
|
||||||
|
EntryHeaderWriteError,
|
||||||
|
ExistingLinkTypeWrong,
|
||||||
}
|
}
|
||||||
|
|
||||||
fn link_error_type_as_str(e: &LinkErrorKind) -> &'static str {
|
fn link_error_type_as_str(e: &LinkErrorKind) -> &'static str {
|
||||||
match e {
|
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",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue