From f2cfd9f048b42e0082db47f6ccf583aa28af78e5 Mon Sep 17 00:00:00 2001 From: Manuel Rego Casasnovas Date: Wed, 18 Jan 2012 07:57:44 +0100 Subject: [PATCH] Improve logging of possible exceptions checking version information Avoid to print the whole stacktrace and simply show a message with the basic exception information. FEA: ItEr76S10NewVersionsNotification --- .../libreplan/business/common/VersionInformation.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/libreplan-business/src/main/java/org/libreplan/business/common/VersionInformation.java b/libreplan-business/src/main/java/org/libreplan/business/common/VersionInformation.java index 57680dc33..414c0b505 100644 --- a/libreplan-business/src/main/java/org/libreplan/business/common/VersionInformation.java +++ b/libreplan-business/src/main/java/org/libreplan/business/common/VersionInformation.java @@ -75,9 +75,13 @@ public class VersionInformation { if (projectVersion != null && lastVersion != null) { newVersionCached = !projectVersion.equals(lastVersion); } + } catch (MalformedURLException e) { + LOG.warn("Problems generating URL to check LibrePlan version. MalformedURLException: " + + e.getMessage()); } catch (IOException e) { - LOG.warn("Problems reading LibrePlan version from " - + LIBREPLAN_VERSION_URL, e); + LOG.info("Could not check LibrePlan version information from " + + LIBREPLAN_VERSION_URL + ". IOException: " + + e.getMessage()); } } @@ -86,7 +90,7 @@ public class VersionInformation { String url = LIBREPLAN_VERSION_URL; if (allowToGatherUsageStatsEnabled) { url += "?" + LIBREPLAN_USAGE_STATS_PARAM + "=1"; - url += "&version=" + projectVersion; + url += "&" + LIBREPLAN_VERSION_PARAM + "=" + projectVersion; } return new URL(url); }