Skip to content

Commit

Permalink
[JENKINS-62710] Ignore arithmetic exception in helper message
Browse files Browse the repository at this point in the history
The printCommitMessageToLog method is a convenience for readers of the
build log.  Failures in printCommitMessageToLog should not fail the build.
  • Loading branch information
MarkEWaite committed Jun 18, 2020
1 parent 7e03c01 commit 3972f28
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/java/hudson/plugins/git/GitSCM.java
Original file line number Diff line number Diff line change
Expand Up @@ -1233,7 +1233,11 @@ public void checkout(Run<?, ?> build, Launcher launcher, FilePath workspace, Tas
// Needs to be after the checkout so that revToBuild is in the workspace
try {
printCommitMessageToLog(listener, git, revToBuild);
} catch (GitException ge) {
} catch (ArithmeticException | GitException ge) {
// JENKINS-45729 reports a git exception when revToBuild cannot be found in the workspace.
// JENKINS-46628 reports a git exception when revToBuild cannot be found in the workspace.
// JENKINS-62710 reports a JGit arithmetic exception on an older Java 8 system.
// Don't let those exceptions block the build, this is an informational message only
listener.getLogger().println("Exception logging commit message for " + revToBuild + ": " + ge.getMessage());
}

Expand Down

0 comments on commit 3972f28

Please sign in to comment.