Search in sources :

Example 1 with ServerIssue

use of org.sonarsource.sonarlint.core.proto.Sonarlint.ServerIssue in project sonarlint-core by SonarSource.

the class PartialUpdater method updateFileIssues.

public void updateFileIssues(ServerApiHelper serverApiHelper, ProjectBinding projectBinding, Sonarlint.ProjectConfiguration projectConfiguration, String ideFilePath, boolean fetchTaintVulnerabilities, @Nullable String branchName, ProgressMonitor progress) {
    var serverIssuesPath = projectStoragePaths.getServerIssuesPath(projectBinding.projectKey());
    var issueStore = issueStoreFactory.apply(serverIssuesPath);
    var fileKey = issueStorePaths.idePathToFileKey(projectConfiguration, projectBinding, ideFilePath);
    if (fileKey == null) {
        return;
    }
    List<ServerIssue> issues;
    try {
        issues = downloader.download(serverApiHelper, fileKey, projectConfiguration, fetchTaintVulnerabilities, branchName, progress);
    } catch (Exception e) {
        // null as cause so that it doesn't get wrapped
        throw new DownloadException("Failed to update file issues: " + e.getMessage(), null);
    }
    issueStore.save(issues);
}
Also used : DownloadException(org.sonarsource.sonarlint.core.client.api.exceptions.DownloadException) ServerIssue(org.sonarsource.sonarlint.core.proto.Sonarlint.ServerIssue) DownloadException(org.sonarsource.sonarlint.core.client.api.exceptions.DownloadException)

Aggregations

DownloadException (org.sonarsource.sonarlint.core.client.api.exceptions.DownloadException)1 ServerIssue (org.sonarsource.sonarlint.core.proto.Sonarlint.ServerIssue)1