Skip to content

Commit

Permalink
fix(logging): dont panic on panic message
Browse files Browse the repository at this point in the history
  • Loading branch information
RouHim committed May 1, 2024
1 parent d4053f0 commit 2c68c90
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/filesystem_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,17 +89,12 @@ fn should_skip_folder(path: &Path) -> bool {

let folder_name = path
.file_name()
.unwrap_or_else(|| {
panic!(
"Failed to get folder name for path: {}",
path.to_str().unwrap()
)
})
.unwrap_or_else(|| panic!("Failed to get folder name for path: {}", path.display()))
.to_str()
.unwrap_or_else(|| {
panic!(
"Failed to convert folder name to string for path: {}",
path.to_str().unwrap()
path.display()
)
});

Expand All @@ -117,7 +112,7 @@ fn should_skip_folder(path: &Path) -> bool {
.unwrap_or_else(|error| {
panic!(
"Failed to read directory: {} Error:\n{}",
path.to_str().unwrap(),
path.display(),
error
)
})
Expand All @@ -126,7 +121,7 @@ fn should_skip_folder(path: &Path) -> bool {
let metadata = entry.metadata().unwrap_or_else(|error| {
panic!(
"Failed to read metadata for: {} Error:\n{}",
entry.path().to_str().unwrap(),
entry.path().display(),
error
)
});
Expand Down

0 comments on commit 2c68c90

Please sign in to comment.