Use try!() instead of unwrapping errors
This commit is contained in:
parent
924692d7cb
commit
2363d6ba30
1 changed files with 4 additions and 6 deletions
|
@ -57,6 +57,7 @@ use hook::Hook;
|
||||||
use libimagerror::into::IntoError;
|
use libimagerror::into::IntoError;
|
||||||
use libimagerror::trace::trace_error;
|
use libimagerror::trace::trace_error;
|
||||||
use libimagutil::iter::FoldResult;
|
use libimagutil::iter::FoldResult;
|
||||||
|
use libimagutil::debug_result::*;
|
||||||
|
|
||||||
use self::glob_store_iter::*;
|
use self::glob_store_iter::*;
|
||||||
|
|
||||||
|
@ -245,12 +246,9 @@ impl Store {
|
||||||
.map_err_into(SEK::IoError);
|
.map_err_into(SEK::IoError);
|
||||||
}
|
}
|
||||||
|
|
||||||
debug!("Creating store path");
|
try!(FileAbstraction::create_dir_all(&location)
|
||||||
let c = FileAbstraction::create_dir_all(&location);
|
.map_err_into(SEK::StorePathCreate)
|
||||||
if c.is_err() {
|
.map_dbg_err_str("Failed"));
|
||||||
debug!("Failed");
|
|
||||||
return Err(SEK::StorePathCreate.into_error_with_cause(Box::new(c.unwrap_err())));
|
|
||||||
}
|
|
||||||
} else if location.is_file() {
|
} else if location.is_file() {
|
||||||
debug!("Store path exists as file");
|
debug!("Store path exists as file");
|
||||||
return Err(SEK::StorePathExists.into_error());
|
return Err(SEK::StorePathExists.into_error());
|
||||||
|
|
Loading…
Reference in a new issue