From ca609bdfeea5e4e49b554d9ff39dd90d080b5f09 Mon Sep 17 00:00:00 2001 From: Teryk Bellahsene Date: Tue, 22 Aug 2017 18:14:30 +0200 Subject: [PATCH] SONAR-9721 Log a debug message when checking telemetry fails --- .../org/sonar/server/telemetry/TelemetryClient.java | 11 +++-------- .../org/sonar/server/telemetry/TelemetryDaemon.java | 2 +- 2 files changed, 4 insertions(+), 9 deletions(-) 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); -- 2.39.5