Improved error message (and flow) when no repository URL is provided to RepoCloner
@@ -130,7 +130,14 @@ public class RepoClonerPlugin extends Plugin {
+ File.separator + product.replace(Constants.mvnCoordinateSeparator, "_")
+ ".json";
repoUrl = json.optString("repoUrl").replaceAll("[\\n\\t ]", "");
- if (!repoUrl.isEmpty()) {
+
+ if (repoUrl.isEmpty()) {
+ var m = "No Repository URL provided in the input record";
+ logger.info(m);
+ this.pluginError = new RepoUrlNotFoundException(m);
+ return;
+ }
+
var gitCloner = new GitCloner(baseDir);
var hgCloner = new HgCloner(baseDir);
var svnCloner = new SvnCloner(baseDir);
@@ -147,10 +154,6 @@ public class RepoClonerPlugin extends Plugin {
logger.error(errMsg);
this.pluginError = new CloneFailedException(errMsg);
}
- } else {
- logger.info("Repository URL not found");
- this.pluginError = new RepoUrlNotFoundException("Repository URL not found");
- }
}
public Pair<String, Triple<Exception, Exception, Exception>> cloneRepo(String repoUrl, String artifact, String group,
