Skip to content

Commit

Permalink
Update error logs
Browse files Browse the repository at this point in the history
  • Loading branch information
mayurikini authored Dec 20, 2024
1 parent 9d0debe commit f2aba69
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,11 @@ impl<T: Socket + ?Sized> Worker<T> {
);
}
Err(err) => {
eprintln!("{err}");
eprintln!(
"Error {err}, while sending {} to {}",
&file_path.file_name().unwrap().to_string_lossy(),
&remote_addr
);
}
}
});
Expand Down Expand Up @@ -126,7 +130,11 @@ impl<T: Socket + ?Sized> Worker<T> {
);
}
Err(err) => {
eprintln!("{err}");
eprintln!(
"Error {err}, while receiving {} from {}",
&file_path.file_name().unwrap().to_string_lossy(),
remote_addr
);
if clean_on_error && fs::remove_file(&file_path).is_err() {
eprintln!("Error while cleaning {}", &file_path.to_str().unwrap());
}
Expand Down

0 comments on commit f2aba69

Please sign in to comment.