add information to panic (#5177)

This commit is contained in:
Rob Walker 2019-07-18 14:41:32 -07:00 committed by GitHub
parent a3a91ba222
commit d47caf2af8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 3 deletions

View File

@ -93,12 +93,17 @@ impl AppendVec {
.create(create)
.open(file)
.map_err(|e| {
warn!("in current dir {:?}", std::env::current_dir());
let mut msg = format!("in current dir {:?}\n", std::env::current_dir());
for ancestor in file.ancestors() {
warn!("{:?} is {:?}", ancestor, std::fs::metadata(ancestor));
msg.push_str(&format!(
"{:?} is {:?}\n",
ancestor,
std::fs::metadata(ancestor)
));
}
panic!(
"Unable to {} data file {}, err {:?}",
"{}Unable to {} data file {}, err {:?}",
msg,
if create { "create" } else { "open" },
file.display(),
e