use of org.sonarlint.intellij.tasks.InformationFetchTask in project sonarlint-intellij by SonarSource.
the class AuthStep method fetchInformation.
private void fetchInformation() throws CommitStepException {
SonarQubeServer tmpServer = model.createServerWithoutOrganization();
InformationFetchTask task = new InformationFetchTask(tmpServer);
ProgressManager.getInstance().run(task);
if (task.getException() == null) {
model.setOrganizationList(task.organizations());
if (task.organizations().size() == 1) {
model.setOrganization(task.organizations().iterator().next().getKey());
} else if (task.organizations().isEmpty()) {
model.setOrganization(null);
}
model.setNotificationsSupported(task.notificationsSupported());
return;
}
String msg = "Failed to fetch information from the server. Please check the configuration and try again.";
if (task.getException().getMessage() != null) {
msg = msg + " Error: " + task.getException().getMessage();
}
throw new CommitStepException(msg);
}
Aggregations