From 8b7bc5afd08cac5753aee8b7ad13d82f6736863f Mon Sep 17 00:00:00 2001 From: Tobias Hahnen Date: Tue, 28 Jan 2025 15:39:44 +0100 Subject: [PATCH] SLCORE-1153: Don't log an error on ProtBuf check for analysis readiness This is just a noisy error when creating a connection and binding a project to determine whether the analysis is yet ready. There is currently no situation in which logging such an error is valid or useful. --- .../core/serverconnection/AnalyzerConfigurationStorage.java | 3 ++- .../core/serverconnection/storage/PluginsStorage.java | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/backend/server-connection/src/main/java/org/sonarsource/sonarlint/core/serverconnection/AnalyzerConfigurationStorage.java b/backend/server-connection/src/main/java/org/sonarsource/sonarlint/core/serverconnection/AnalyzerConfigurationStorage.java index 0150cad151..116d7a7aa1 100644 --- a/backend/server-connection/src/main/java/org/sonarsource/sonarlint/core/serverconnection/AnalyzerConfigurationStorage.java +++ b/backend/server-connection/src/main/java/org/sonarsource/sonarlint/core/serverconnection/AnalyzerConfigurationStorage.java @@ -60,7 +60,8 @@ private Optional tryRead() { try { return Optional.of(read()); } catch (Exception e) { - LOG.error("Could not load analyzer configuration storage", e); + // Don't log an error as this is currently only used for checking whether or not the analysis is ready as well as the file exclusion + // service after a binding change. The error was just noisy and misleading to users. return Optional.empty(); } } diff --git a/backend/server-connection/src/main/java/org/sonarsource/sonarlint/core/serverconnection/storage/PluginsStorage.java b/backend/server-connection/src/main/java/org/sonarsource/sonarlint/core/serverconnection/storage/PluginsStorage.java index 94867600b4..ae2136e40d 100644 --- a/backend/server-connection/src/main/java/org/sonarsource/sonarlint/core/serverconnection/storage/PluginsStorage.java +++ b/backend/server-connection/src/main/java/org/sonarsource/sonarlint/core/serverconnection/storage/PluginsStorage.java @@ -54,8 +54,9 @@ public boolean isValid() { try { rwLock.read(() -> ProtobufFileUtil.readFile(pluginReferencesFilePath, Sonarlint.PluginReferences.parser())); return true; - } catch (Exception e) { - LOG.error("Could not load plugins storage", e); + } catch (Exception ignored) { + // Don't log an error or forward it as this is only used for checking whether or not the analysis is ready yet. The error was just + // noisy and misleading to users. return false; } }