From: Teryk Bellahsene Date: Tue, 22 Aug 2017 16:14:30 +0000 (+0200) Subject: SONAR-9721 Log a debug message when checking telemetry fails X-Git-Tag: 6.6-RC1~510 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ca609bdfeea5e4e49b554d9ff39dd90d080b5f09;p=sonarqube.git SONAR-9721 Log a debug message when checking telemetry fails --- diff --git a/server/sonar-server/src/main/java/org/sonar/server/telemetry/TelemetryClient.java b/server/sonar-server/src/main/java/org/sonar/server/telemetry/TelemetryClient.java index e977387997c..86c3766172f 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/telemetry/TelemetryClient.java +++ b/server/sonar-server/src/main/java/org/sonar/server/telemetry/TelemetryClient.java @@ -20,7 +20,6 @@ package org.sonar.server.telemetry; -import com.google.common.base.Throwables; import java.io.IOException; import okhttp3.MediaType; import okhttp3.OkHttpClient; @@ -46,13 +45,9 @@ public class TelemetryClient { this.config = config; } - void send(String json) { - try { - Request request = buildHttpRequest(json); - okHttpClient.newCall(request).execute(); - } catch (IOException e) { - Throwables.propagate(e); - } + void send(String json) throws IOException { + Request request = buildHttpRequest(json); + okHttpClient.newCall(request).execute(); } void optOut(String json) { diff --git a/server/sonar-server/src/main/java/org/sonar/server/telemetry/TelemetryDaemon.java b/server/sonar-server/src/main/java/org/sonar/server/telemetry/TelemetryDaemon.java index f04afd3e228..8567c61d51a 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/telemetry/TelemetryDaemon.java +++ b/server/sonar-server/src/main/java/org/sonar/server/telemetry/TelemetryDaemon.java @@ -111,7 +111,7 @@ public class TelemetryDaemon implements Startable { telemetryClient.send(json.toString()); internalProperties.write(I_PROP_LAST_PING, String.valueOf(startOfDay(now))); } catch (Exception e) { - // fail silently + LOG.debug("Error while checking SonarQube statistics: {}", e.getMessage()); } // do not check at start up to exclude test instance which are not up for a long time }, frequencyInSeconds, frequencyInSeconds, TimeUnit.SECONDS);