Skip to content

Commit

Permalink
add error message to show th filename when the file not fund
Browse files Browse the repository at this point in the history
  • Loading branch information
HaoranYi committed Sep 12, 2024
1 parent edda97e commit b2b08b6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion accounts-db/store-histogram/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,9 @@ fn main() {
for entry in dir.flatten() {
if let Some(name) = entry.path().file_name() {
let name = name.to_str().unwrap().split_once(".").unwrap().0;
let len = fs::metadata(entry.path()).unwrap().len();
let len = fs::metadata(entry.path())
.unwrap_or_else(|_| panic!("{:?} not found!", entry.path()))
.len();
info.push((name.parse::<usize>().unwrap(), len as usize));
// eprintln!("{name}, {len}");
}
Expand Down

0 comments on commit b2b08b6

Please sign in to comment.