diff --git a/src/main/java/org/jenkinsci/plugins/ghprb/GhprbPullRequest.java b/src/main/java/org/jenkinsci/plugins/ghprb/GhprbPullRequest.java index dd8970da7..2da1aac8c 100644 --- a/src/main/java/org/jenkinsci/plugins/ghprb/GhprbPullRequest.java +++ b/src/main/java/org/jenkinsci/plugins/ghprb/GhprbPullRequest.java @@ -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); } @@ -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); } @@ -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); } } @@ -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); } @@ -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); } @@ -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); } diff --git a/src/main/java/org/jenkinsci/plugins/ghprb/GhprbRootAction.java b/src/main/java/org/jenkinsci/plugins/ghprb/GhprbRootAction.java index 06ad17ffc..383619982 100644 --- a/src/main/java/org/jenkinsci/plugins/ghprb/GhprbRootAction.java +++ b/src/main/java/org/jenkinsci/plugins/ghprb/GhprbRootAction.java @@ -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();