Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add AbortException comment for retry
Attempt to avoid losing the fix for JENKINS-20531 in future
changes. No easy way to create a test which asserts an error is thrown
when fetch() throws an exception, so insert the comment as a weaker
defense against regression.
  • Loading branch information
MarkEWaite committed Oct 29, 2014
1 parent b6174a1 commit c3a4092
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main/java/hudson/plugins/git/GitSCM.java
Expand Up @@ -896,6 +896,8 @@ private void retrieveChanges(AbstractBuild build, GitClient git, BuildListener l
try {
fetchFrom(git, listener, remoteRepository);
} catch (GitException ex) {
/* Allow retry by throwing AbortException instead of
* GitException. See JENKINS-20531. */
ex.printStackTrace(listener.error("Error fetching changes from repo '%s'", remoteRepository.getName()));
throw new AbortException();
}
Expand Down

0 comments on commit c3a4092

Please sign in to comment.