Skip to content
Permalink
Browse files

[FIXED JENKINS-14629] return null to notify about checkout failure

relates to [JENKINS-12201]
  • Loading branch information...
ndeloof committed Jul 30, 2012
1 parent 9f19244 commit 09f17089fdbbfa202735bbd4fc4f0aa241045e64
@@ -684,7 +684,7 @@ public boolean checkout(AbstractBuild build, Launcher launcher, FilePath workspa

List<External> externals = checkout(build,workspace,listener,env);

if(externals==null)
if (externals==null)
return false;

// write out the revision file
@@ -741,6 +741,10 @@ public boolean checkout(AbstractBuild build, Launcher launcher, FilePath workspa
List<External> externals = new ArrayList<External>();
for (ModuleLocation location : getLocations(env, build)) {
List<External> externalsFound = workspace.act(new CheckOutTask(build, this, location, build.getTimestamp().getTime(), listener, env));
if (externalsFound == null) {
// An error occurred during checkout
return null;
}
externals.addAll( externalsFound );
// olamy: remove null check at it cause test failure
// see https://github.com/jenkinsci/subversion-plugin/commit/de23a2b781b7b86f41319977ce4c11faee75179b#commitcomment-1551273
@@ -164,7 +164,7 @@ private SVNInfo parseSvnInfo(File workspace) throws SVNException {
if (e.getErrorMessage().getErrorCode() == SVNErrorCode.WC_NOT_LOCKED) {
listener.getLogger().println("Polled jobs are " + Hudson.getInstance().getDescriptorByType(SCMTrigger.DescriptorImpl.class).getItemsBeingPolled());
}
return Collections.EMPTY_LIST;
return null;

This comment has been minimized.

Copy link
@kutzi

kutzi Aug 8, 2012

Member

Javadoc of UpdateTask#perform explicitly states: '@return Where svn:external mounting happened. Can be empty but never null.'
So either we change the Javadoc or - as I'd prefer - throw an exception to indicate the error.

}

return externals;

4 comments on commit 09f1708

@ndeloof

This comment has been minimized.

Copy link
Member Author

replied Aug 9, 2012

throwing an exception would make things cleaner, but I'm confused how it will be thrown through the remote channel and we can catch it a consistent way.

@kutzi

This comment has been minimized.

Copy link
Member

replied Aug 9, 2012

Add an unit test for it and you'll know ;-)

@dty

This comment has been minimized.

Copy link
Member

replied Aug 16, 2012

The catch block for SVNCancelException already throws an InterruptedException, so throwing an IOException for the general SVNException seems like it would be more consistent than returning null.

@ndeloof

This comment has been minimized.

Copy link
Member Author

replied Aug 21, 2012

fixed at 7f594bc

Please sign in to comment.
You can’t perform that action at this time.