From f30d13609bc0384453701f1ab881799c77ddf89f Mon Sep 17 00:00:00 2001 From: 0xboobface <0xboobface@gmail.com> Date: Tue, 28 Aug 2018 17:13:35 +0200 Subject: [PATCH] Improve exception handling Make sure, the status is reset to FINISHED, if something goes wrong while downloading, so that the context menu is reactivated --- src/main/java/ctbrec/ui/RecordingsTab.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/main/java/ctbrec/ui/RecordingsTab.java b/src/main/java/ctbrec/ui/RecordingsTab.java index f709b584..fa5a1595 100644 --- a/src/main/java/ctbrec/ui/RecordingsTab.java +++ b/src/main/java/ctbrec/ui/RecordingsTab.java @@ -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); } } };