]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-9721 Log a debug message when checking telemetry fails
authorTeryk Bellahsene <teryk.bellahsene@sonarsource.com>
Tue, 22 Aug 2017 16:14:30 +0000 (18:14 +0200)
committerTeryk Bellahsene <teryk@users.noreply.github.com>
Wed, 30 Aug 2017 14:24:53 +0000 (16:24 +0200)
server/sonar-server/src/main/java/org/sonar/server/telemetry/TelemetryClient.java
server/sonar-server/src/main/java/org/sonar/server/telemetry/TelemetryDaemon.java

index e977387997c12422e00179499cba5aeb2cc91e5f..86c3766172ffe5c4fefc4b6a8c1c1acbbca65459 100644 (file)
@@ -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) {
index f04afd3e228cbb93e3b69b109f6b6edb806a61b3..8567c61d51a6a7e8ab635dc1fcc57151e3dcde50 100644 (file)
@@ -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);