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:
parent
469bdd1d94
commit
78701c7332
1 changed files with 2 additions and 0 deletions
|
@ -10,6 +10,7 @@ use std::io::Error as IOError;
|
||||||
|
|
||||||
#[derive(Clone, Copy, Debug)]
|
#[derive(Clone, Copy, Debug)]
|
||||||
pub enum StoreErrorKind {
|
pub enum StoreErrorKind {
|
||||||
|
IdLocked,
|
||||||
IdNotFound,
|
IdNotFound,
|
||||||
OutOfMemory,
|
OutOfMemory,
|
||||||
// maybe more
|
// maybe more
|
||||||
|
@ -17,6 +18,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::IdLocked => "ID locked",
|
||||||
&StoreErrorKind::IdNotFound => "ID not found",
|
&StoreErrorKind::IdNotFound => "ID not found",
|
||||||
&StoreErrorKind::OutOfMemory => "Out of Memory",
|
&StoreErrorKind::OutOfMemory => "Out of Memory",
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue