forked from j62/ctbrec
1
0
Fork 0

Don't log error, if recordings dir does not exist

If the recordings dir does not exist, don't log an error, but instead
set the tooltip to show the problem
This commit is contained in:
0xboobface 2018-11-30 15:04:02 +01:00
parent ad1f841167
commit fedf38004d
1 changed files with 5 additions and 0 deletions

View File

@ -6,6 +6,7 @@ import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.net.URL;
import java.nio.file.NoSuchFileException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.text.DecimalFormat;
@ -316,6 +317,10 @@ public class RecordingsTab extends Tab implements TabSelectionListener {
try {
spaceTotal = recorder.getTotalSpaceBytes();
spaceFree = recorder.getFreeSpaceBytes();
Platform.runLater(() -> spaceLeft.setTooltip(new Tooltip()));
} catch (NoSuchFileException e) {
// recordings dir does not exist
Platform.runLater(() -> spaceLeft.setTooltip(new Tooltip("Recordings directory does not exist")));
} catch (IOException e) {
LOG.error("Couldn't update free space", e);
}