Skip to content

Commit

Permalink
Improved FileSync stability.
Browse files Browse the repository at this point in the history
Sometimes, music files just can't be copied, even with 'cp' on terminal. Just ignore those files and print an error, as this should be rare cases.
  • Loading branch information
krizleebear committed Aug 26, 2022
1 parent 19051a5 commit 7995989
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/de/christianleberfinger/melodies2go/FileSync.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.io.File;
import java.io.IOException;
import java.nio.file.FileSystemException;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.text.Normalizer;
Expand Down Expand Up @@ -270,7 +271,13 @@ private void copyMissingFiles() throws IOException

if (!destFile.exists())
{
copyFile(track, destFile);
try {
copyFile(track, destFile);
} catch (FileSystemException fse) {
// sometimes, music files just can't be copied, even with 'cp' on terminal.
// just ignore those files and print an error, as this should be a rare case.
System.err.println("Filesystem Error copying " + destFile);
}
}
}
}
Expand Down

0 comments on commit 7995989

Please sign in to comment.