diff options
author | Andreas Abraham <andreas.abraham@egiz.gv.at> | 2020-09-03 16:40:55 +0200 |
---|---|---|
committer | Andreas Abraham <andreas.abraham@egiz.gv.at> | 2020-09-03 16:40:55 +0200 |
commit | 5cbb56a14bf5ad4bbe4503090526eaf34a144829 (patch) | |
tree | 535d1398d513692e95dffb8463add8e26d7db3d8 /utils/src | |
parent | 52bec2993a9996582568d5d131ed90d44f7844f1 (diff) | |
download | mocca-5cbb56a14bf5ad4bbe4503090526eaf34a144829.tar.gz mocca-5cbb56a14bf5ad4bbe4503090526eaf34a144829.tar.bz2 mocca-5cbb56a14bf5ad4bbe4503090526eaf34a144829.zip |
Added Exception
Diffstat (limited to 'utils/src')
-rw-r--r-- | utils/src/main/java/at/gv/egiz/updater/MoccaUpdater.java | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/utils/src/main/java/at/gv/egiz/updater/MoccaUpdater.java b/utils/src/main/java/at/gv/egiz/updater/MoccaUpdater.java index 4e2cbcd8..25927900 100644 --- a/utils/src/main/java/at/gv/egiz/updater/MoccaUpdater.java +++ b/utils/src/main/java/at/gv/egiz/updater/MoccaUpdater.java @@ -70,15 +70,20 @@ public class MoccaUpdater { return;
}
- gatherOnlineMoccaVersion();
- boolean isOnlineNewer = isOnlineVersionNewer();
- if (isOnlineNewer) {
- notifyUserNewerVersionOnline();
+ try {
+ gatherOnlineMoccaVersion();
+ boolean isOnlineNewer = isOnlineVersionNewer();
+ if (isOnlineNewer) {
+ notifyUserNewerVersionOnline();
+ }
+ } catch (Exception e) {
+ System.out.println(e.getMessage());
+ log.error(e.getMessage());
}
}
- private void gatherOnlineMoccaVersion() {
+ private void gatherOnlineMoccaVersion() throws Exception {
try {
log.info("Requesting Mocca Online Version");
URL url = new URL(Constants.VERSION_FILE_URL);
@@ -96,6 +101,7 @@ public class MoccaUpdater { log.info("Online Mocca Version: " + result.toString());
} catch (IOException e) {
log.error("Error when gathering Mocca Online Version " + e.getMessage());
+ throw new Exception("Error gathering Mocca Version number from Website ");
}
}
@@ -113,6 +119,7 @@ public class MoccaUpdater { dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
dialog.setVisible(true);
} catch (Exception e) {
+ System.err.print(e.getMessage());
log.error(e.getMessage());
}
|