Skip to content

Commit

Permalink
Merge pull request #570 from sverkera/master
Browse files Browse the repository at this point in the history
Fix for #523
  • Loading branch information
samrocketman authored Nov 20, 2017
2 parents 4802dfb + fe2a4da commit 19d5540
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
15 changes: 13 additions & 2 deletions src/main/java/org/jenkinsci/plugins/ghprb/GhprbPullRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ private void checkBlackListLabels() {
shouldRun = false;
}
}
} catch(Error e) {
logger.log(Level.SEVERE, "Failed to read blacklist labels", e);
} catch(IOException e) {
logger.log(Level.SEVERE, "Failed to read blacklist labels", e);
}
Expand All @@ -206,6 +208,8 @@ private void checkWhiteListLabels() {
logger.log(Level.INFO, "Can't find any of whitelist label.");
shouldRun = false;
}
} catch(Error e) {
logger.log(Level.SEVERE, "Failed to read whitelist labels", e);
} catch(IOException e) {
logger.log(Level.SEVERE, "Failed to read whitelist labels", e);
}
Expand Down Expand Up @@ -321,8 +325,9 @@ else if (comment != null) {
);
}
}
}
catch (IOException ex) {
} catch (Error e) {
logger.log(Level.SEVERE, "Exception caught while updating the PR", e);
} catch (IOException ex) {
logger.log(Level.SEVERE, "Exception caught while updating the PR", ex);
}
}
Expand Down Expand Up @@ -379,6 +384,8 @@ private GitUser getPRCommitAuthor (){
return commitDetails.getCommit().getCommitter();
}
}
} catch (Error e) {
logger.log(Level.INFO, "Unable to get PR commits: ", e);
} catch (Exception ex) {
logger.log(Level.INFO, "Unable to get PR commits: ", ex);
}
Expand Down Expand Up @@ -588,6 +595,8 @@ private int checkComments(GHPullRequest ghpr,
}
}
}
} catch (Error e) {
logger.log(Level.SEVERE, "Couldn't obtain comments.", e);
} catch (IOException e) {
logger.log(Level.SEVERE, "Couldn't obtain comments.", e);
}
Expand All @@ -610,6 +619,8 @@ public boolean checkMergeable() {
isMergeable = pr.getMergeable();
}
mergeable = isMergeable != null && isMergeable;
} catch (Error e) {
logger.log(Level.SEVERE, "Couldn't obtain mergeable status.", e);
} catch (IOException e) {
logger.log(Level.SEVERE, "Couldn't obtain mergeable status.", e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,13 +250,13 @@ private void triggerPr(final GhprbTrigger trigger,
public void run() {
try {
trigger.handlePR(pr);
} catch (Exception e) {
} catch (Throwable th) {
StringBuilder sb = new StringBuilder();
sb.append("Unable to handle PR# ");
sb.append(pr.getNumber());
sb.append(" for repo: ");
sb.append(pr.getRepository().getFullName());
logger.log(Level.SEVERE, sb.toString(), e);
logger.log(Level.SEVERE, sb.toString(), th);
}
}
}.start();
Expand Down

0 comments on commit 19d5540

Please sign in to comment.