From 78701c73325b37446d8c2086126eba3f820fee86 Mon Sep 17 00:00:00 2001 From: Julian Ganz Date: Sun, 17 Jan 2016 16:20:58 +0100 Subject: [PATCH] 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. --- libimagstore/src/error.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libimagstore/src/error.rs b/libimagstore/src/error.rs index 8a2d56d8..4b36d3dc 100644 --- a/libimagstore/src/error.rs +++ b/libimagstore/src/error.rs @@ -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", }