diff --git a/lib/core/libimagstore/src/error.rs b/lib/core/libimagstore/src/error.rs index ca8df222..4fb3a44a 100644 --- a/lib/core/libimagstore/src/error.rs +++ b/lib/core/libimagstore/src/error.rs @@ -29,6 +29,7 @@ error_chain! { foreign_links { Io(::std::io::Error); TomlDeserError(::toml::de::Error); + GlobPatternError(::glob::PatternError); } errors { @@ -158,11 +159,6 @@ error_chain! { display("Header type is wrong") } - GlobError { - description("glob() error") - display("glob() error") - } - EncodingError { description("Encoding error") display("Encoding error") diff --git a/lib/core/libimagstore/src/store.rs b/lib/core/libimagstore/src/store.rs index aa3b099f..52426050 100644 --- a/lib/core/libimagstore/src/store.rs +++ b/lib/core/libimagstore/src/store.rs @@ -507,10 +507,9 @@ impl Store { .and_then(|path| { let path = [ path, "/**/*" ].join(""); debug!("glob()ing with '{}'", path); - glob(&path[..]).chain_err(|| SEK::GlobError) + glob(&path[..]).map_err(From::from) }) .map(|paths| GlobStoreIdIterator::new(paths, self.path().clone()).into()) - .chain_err(|| SEK::GlobError) .chain_err(|| SEK::RetrieveForModuleCallError) }