summaryrefslogtreecommitdiff
path: root/utils/src/main/java/at/gv/egiz/updater
diff options
context:
space:
mode:
authorAndreas Abraham <andreas.abraham@egiz.gv.at>2020-09-03 16:40:55 +0200
committerAndreas Abraham <andreas.abraham@egiz.gv.at>2020-09-03 16:40:55 +0200
commit5cbb56a14bf5ad4bbe4503090526eaf34a144829 (patch)
tree535d1398d513692e95dffb8463add8e26d7db3d8 /utils/src/main/java/at/gv/egiz/updater
parent52bec2993a9996582568d5d131ed90d44f7844f1 (diff)
downloadmocca-5cbb56a14bf5ad4bbe4503090526eaf34a144829.tar.gz
mocca-5cbb56a14bf5ad4bbe4503090526eaf34a144829.tar.bz2
mocca-5cbb56a14bf5ad4bbe4503090526eaf34a144829.zip
Added Exception
Diffstat (limited to 'utils/src/main/java/at/gv/egiz/updater')
-rw-r--r--utils/src/main/java/at/gv/egiz/updater/MoccaUpdater.java17
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());
}