From 5cbb56a14bf5ad4bbe4503090526eaf34a144829 Mon Sep 17 00:00:00 2001 From: Andreas Abraham Date: Thu, 3 Sep 2020 16:40:55 +0200 Subject: Added Exception --- .../src/main/java/at/gv/egiz/updater/MoccaUpdater.java | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'utils/src/main/java/at') 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()); } -- cgit v1.2.3