If a file copy fails, log the reason

This commit is contained in:
2010-01-14 07:27:30 +00:00
parent 3ccfeab314
commit 378c652d20

View File

@@ -126,7 +126,10 @@ sub process_completed_directory {
my $output_filename = $output_dir . '/' . $completed_torrent;
# Copy the file over to the media share
copy_to_media_share($completed_filename, $output_filename) or next;
if (!copy_to_media_share($completed_filename, $output_filename)) {
$log->error("Failed to copy $completed_filename to $output_filename: $!");
next;
}
# Attempt to rename the file
my $final_filename = $output_filename;