Skip to content
Permalink
Browse files
[JENKINS-14575] Wrap GitException into IOException
The retry logic does not catch the GitException, so we have to wrap into a IOException. Clone and Fetch also affected. As of now the scmRetry will work with the git plugin.
  • Loading branch information
Adam PAPAI committed Mar 28, 2013
1 parent 3ab1db8 commit d82a9f3c06e33d5d547a7b1e15cf7c72b7773c58
Showing 1 changed file with 9 additions and 3 deletions.
@@ -1010,17 +1010,23 @@ public Collection<Revision> invoke(File localWorkspace, VirtualChannel channel)

if (!successfullyCloned) {
listener.error("Could not clone repository");
throw new GitException("Could not clone");
// Throw IOException so the retry will be able to catch it
throw new IOException("Could not clone");
}

boolean fetched = false;
for (RemoteConfig remoteRepository : repos) {
fetched |= fetchFrom(git, listener, remoteRepository);
try {
fetched |= fetchFrom(git, listener, remoteRepository);
} catch (GitException ex) {
fetched |= false;
}
}

if (!fetched) {
listener.error("Could not fetch from any repository");
throw new GitException("Could not fetch from any repository");
// Throw IOException so the retry will be able to catch it
throw new IOException("Could not fetch from any repository");
}

if (clean) {

0 comments on commit d82a9f3

Please sign in to comment.