Skip to content

Commit 932aa1d

Browse files
authored
SLCORE-1850 Avoid excessive logging for code context (#1593)
1 parent 6c06fc4 commit 932aa1d

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

backend/core/src/main/java/org/sonarsource/sonarlint/core/SonarCodeContextService.java

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -115,19 +115,23 @@ public void onBindingChanged(BindingConfigChangedEvent event) {
115115
}
116116

117117
private void handleGeneration(String configScopeId, Path baseDir, Binding binding) {
118-
var paramsOpt = prepareCliParams(binding, configScopeId);
119-
if (paramsOpt.isPresent()) {
120-
var workingDir = computeWorkingBaseDir(baseDir);
121-
if (initializedScopes.add(configScopeId)) {
122-
runInit(workingDir);
123-
}
124-
runGenerateGuidelines(workingDir, paramsOpt.get());
125-
runMergeMd(workingDir);
126-
if (mdcInstalledScopes.add(configScopeId)) {
127-
runInstall(workingDir);
118+
try {
119+
var paramsOpt = prepareCliParams(binding, configScopeId);
120+
if (paramsOpt.isPresent()) {
121+
var workingDir = computeWorkingBaseDir(baseDir);
122+
if (initializedScopes.add(configScopeId)) {
123+
runInit(workingDir);
124+
}
125+
runGenerateGuidelines(workingDir, paramsOpt.get());
126+
runMergeMd(workingDir);
127+
if (mdcInstalledScopes.add(configScopeId)) {
128+
runInstall(workingDir);
129+
}
130+
} else {
131+
LOG.debug("Missing parameters for SonarCodeContext CLI, skipping for configuration scope '{}'", configScopeId);
128132
}
129-
} else {
130-
LOG.debug("Missing parameters for SonarCodeContext CLI, skipping for configuration scope '{}'", configScopeId);
133+
} catch (Exception e) {
134+
LOG.debug("[DOGFOOD] Failed to run code context CLI", e.getMessage());
131135
}
132136
}
133137

0 commit comments

Comments
 (0)