Add encoding error if typeconversion fails
This commit is contained in:
parent
fe0849f8eb
commit
041a2a4942
2 changed files with 5 additions and 2 deletions
|
@ -34,6 +34,7 @@ pub enum StoreErrorKind {
|
|||
PostHookExecuteError,
|
||||
StorePathLacksVersion,
|
||||
GlobError,
|
||||
EncodingError,
|
||||
// maybe more
|
||||
}
|
||||
|
||||
|
@ -64,6 +65,7 @@ fn store_error_type_as_str(e: &StoreErrorKind) -> &'static str {
|
|||
&StoreErrorKind::PostHookExecuteError => "Post-Hook execution error",
|
||||
&StoreErrorKind::StorePathLacksVersion => "The supplied store path has no version part",
|
||||
&StoreErrorKind::GlobError => "glob() error",
|
||||
&StoreErrorKind::EncodingError => "Encoding error",
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -315,10 +315,11 @@ impl Store {
|
|||
if let Some(path) = path.to_str() {
|
||||
let path = [ path, "/*" ].join("");
|
||||
debug!("glob()ing with '{}'", path);
|
||||
glob(&path[..]).map(StoreIdIterator::new)
|
||||
glob(&path[..])
|
||||
.map(StoreIdIterator::new)
|
||||
.map_err(|e| StoreError::new(StoreErrorKind::GlobError, Some(Box::new(e))))
|
||||
} else {
|
||||
unimplemented!()
|
||||
Err(StoreError::new(StoreErrorKind::EncodingError, None))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue