From e45d9200bfd45759d6a5cf02e2b639968cb5bddf Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Mon, 23 May 2016 15:21:16 +0200 Subject: [PATCH] Adapt error generating code in libimagstore --- libimagstore/src/error.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/libimagstore/src/error.rs b/libimagstore/src/error.rs index 3e32bf96..997da6c0 100644 --- a/libimagstore/src/error.rs +++ b/libimagstore/src/error.rs @@ -1,7 +1,10 @@ generate_error_imports!(); use std::convert::From; -generate_error_types!(StoreError, StoreErrorKind, +#[derive(Debug, Clone, Eq, PartialEq, Ord, PartialOrd, Copy)] +pub struct CustomErrorData {} + +generate_custom_error_types!(StoreError, StoreErrorKind, CustomErrorData, ConfigurationError => "Store Configuration Error", FileError => "File Error", IoError => "IO Error", @@ -31,7 +34,7 @@ generate_error_types!(StoreError, StoreErrorKind, EncodingError => "Encoding error" ); -generate_error_types!(ParserError, ParserErrorKind, +generate_custom_error_types!(ParserError, ParserErrorKind, CustomErrorData, TOMLParserErrors => "Several TOML-Parser-Errors", MissingMainSection => "Missing main section", MissingVersionInfo => "Missing version information in main section", @@ -44,6 +47,7 @@ impl From for StoreError { StoreError { err_type: StoreErrorKind::MalformedEntry, cause: Some(Box::new(ps)), + custom_data: None, } } } @@ -53,6 +57,7 @@ impl From<::std::io::Error> for StoreError { StoreError { err_type: StoreErrorKind::IoError, cause: Some(Box::new(ps)), + custom_data: None, } } }