Improve exception handling

Make sure, the status is reset to FINISHED, if something goes wrong
while downloading, so that the context menu is reactivated
This commit is contained in:
0xboobface 2018-08-28 17:13:35 +02:00
parent 1383199532
commit f30d13609b
1 changed files with 7 additions and 6 deletions

View File

@ -373,6 +373,13 @@ public class RecordingsTab extends Tab implements TabSelectionListener {
});
}
} catch (FileNotFoundException e) {
showErrorDialog("Error while downloading recording", "The target file couldn't be created", e);
LOG.error("Error while downloading recording", e);
} catch (IOException e) {
showErrorDialog("Error while downloading recording", "The recording could not be downloaded", e);
LOG.error("Error while downloading recording", e);
} finally {
Platform.runLater(new Runnable() {
@Override
public void run() {
@ -380,12 +387,6 @@ public class RecordingsTab extends Tab implements TabSelectionListener {
recording.setProgress(-1);
}
});
} catch (FileNotFoundException e) {
showErrorDialog("Error while downloading recording", "The target file couldn't be created", e);
LOG.error("Error while downloading recording", e);
} catch (IOException e) {
showErrorDialog("Error while downloading recording", "The recording could not be downloaded", e);
LOG.error("Error while downloading recording", e);
}
}
};