Add error type for communicating that an entry is locked

We need this error type to let the user know when she is trying to
remove an item which is currently edited.
This commit is contained in:
Julian Ganz 2016-01-17 16:20:58 +01:00
parent 469bdd1d94
commit 78701c7332

View file

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