use of org.monarchinitiative.loinc2hpo.github.GitHubPoster in project loinc2hpo by monarch-initiative.
the class AnnotateTabController method postGitHubIssue.
private void postGitHubIssue(String message, String title, String uname, String pword, List<String> chosenLabels) {
GitHubPoster poster = new GitHubPoster(uname, pword, title, message);
this.githubUsername = uname;
this.githubPassword = pword;
if (chosenLabels != null && !chosenLabels.isEmpty()) {
logger.trace("Labels being chosen: ");
chosenLabels.forEach(logger::trace);
poster.setLabel(chosenLabels);
logger.trace("Labels sent to poster: \t");
logger.trace(poster.debugLabelsArray4Json());
}
try {
logger.trace("Message sent to Github: \t" + poster.debugReformatpayloadWithLabel());
poster.postIssue();
} catch (NetPostException he) {
PopUps.showException("GitHub error", "Bad Request (400): Could not post issue", he);
} catch (Exception ex) {
PopUps.showException("GitHub error", "GitHub error: Could not post issue", ex);
return;
}
String response = poster.getHttpResponse();
PopUps.showInfoMessage(String.format("Created issue for %s\nServer response: %s", loincIdSelected.toString(), response), "Created new issue");
}
Aggregations