Skip to content

Commit

Permalink
Fix issue jenkinsci#232 due to changes in underlying api
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Dumont committed May 7, 2015
1 parent f64f385 commit f5bdc3e
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/main/java/org/jenkinsci/plugins/ghprb/GhprbRepository.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public void check() {
if (!initGhRepository()) {
return;
}

if (helper.isProjectDisabled()) {
logger.log(Level.FINE, "Project is disabled, not checking github state");
return;
Expand Down Expand Up @@ -144,16 +144,12 @@ public void createCommitStatus(AbstractBuild<?, ?> build, String sha1, GHCommitS
} else {
ghRepository.createCommitStatus(sha1, state, url, message);
}
} catch (FileNotFoundException ex) {
newMessage = "FileNotFoundException means that the credentials Jenkins is using is probably wrong. Or that something is really wrong with github.";
if (stream != null) {
stream.println(newMessage);
ex.printStackTrace(stream);
} catch (IOException ex) {
if (ex instanceof FileNotFoundException) {
newMessage = "FileNotFoundException means that the credentials Jenkins is using is probably wrong. Or the user account does not have write access to the repo.";
} else {
logger.log(Level.INFO, newMessage, ex);
newMessage = "Could not update commit status of the Pull Request on GitHub.";
}
} catch (IOException ex) {
newMessage = "Could not update commit status of the Pull Request on GitHub.";
if (stream != null) {
stream.println(newMessage);
ex.printStackTrace(stream);
Expand Down

0 comments on commit f5bdc3e

Please sign in to comment.