From f5bdc3e59f51707e06bf77caaae67dca797cd32c Mon Sep 17 00:00:00 2001 From: Dan Dumont Date: Thu, 7 May 2015 10:36:04 -0400 Subject: [PATCH] Fix issue #232 due to changes in underlying api --- .../jenkinsci/plugins/ghprb/GhprbRepository.java | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/main/java/org/jenkinsci/plugins/ghprb/GhprbRepository.java b/src/main/java/org/jenkinsci/plugins/ghprb/GhprbRepository.java index df5b62f93..b5f2be865 100644 --- a/src/main/java/org/jenkinsci/plugins/ghprb/GhprbRepository.java +++ b/src/main/java/org/jenkinsci/plugins/ghprb/GhprbRepository.java @@ -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; @@ -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);