Add new error type for low-level file system errors

This commit is contained in:
Julian Ganz 2016-01-17 18:01:52 +01:00
parent 78701c7332
commit bcebe86546

View file

@ -10,6 +10,7 @@ use std::io::Error as IOError;
#[derive(Clone, Copy, Debug)] #[derive(Clone, Copy, Debug)]
pub enum StoreErrorKind { pub enum StoreErrorKind {
FileError,
IdLocked, IdLocked,
IdNotFound, IdNotFound,
OutOfMemory, OutOfMemory,
@ -18,6 +19,7 @@ pub enum StoreErrorKind {
fn store_error_type_as_str(e: &StoreErrorKind) -> &'static str { fn store_error_type_as_str(e: &StoreErrorKind) -> &'static str {
match e { match e {
&StoreErrorKind::FileError => "File Error",
&StoreErrorKind::IdLocked => "ID locked", &StoreErrorKind::IdLocked => "ID locked",
&StoreErrorKind::IdNotFound => "ID not found", &StoreErrorKind::IdNotFound => "ID not found",
&StoreErrorKind::OutOfMemory => "Out of Memory", &StoreErrorKind::OutOfMemory => "Out of Memory",