Skip to content

Commit

Permalink
don't let a failure to load one promotion process fail the rest of th…
Browse files Browse the repository at this point in the history
…e processes to load.
  • Loading branch information
kohsuke committed Jun 21, 2012
1 parent 01134e9 commit cd41ec1
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/main/java/hudson/plugins/promoted_builds/JobPropertyImpl.java
@@ -1,12 +1,9 @@
package hudson.plugins.promoted_builds;

import antlr.ANTLRException;
import hudson.Extension;
import hudson.Util;
import hudson.model.AbstractBuild;
import hudson.model.AbstractProject;
import hudson.model.Action;
import hudson.model.AutoCompletionCandidates;
import hudson.model.BuildListener;
import hudson.model.Descriptor;
import hudson.model.Failure;
Expand All @@ -17,9 +14,6 @@
import hudson.model.Job;
import hudson.model.JobProperty;
import hudson.model.JobPropertyDescriptor;
import hudson.model.Label;
import hudson.tasks.BuildStep;
import hudson.util.FormValidation;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.kohsuke.stapler.Ancestor;
Expand All @@ -32,8 +26,8 @@
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.regex.Pattern;
import org.kohsuke.stapler.QueryParameter;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
* Promotion processes defined for a project.
Expand Down Expand Up @@ -118,8 +112,12 @@ public boolean accept(File child) {
});
if(subdirs!=null) {
for (File subdir : subdirs) {
PromotionProcess p = (PromotionProcess) Items.load(this, subdir);
processes.add(p);
try {
PromotionProcess p = (PromotionProcess) Items.load(this, subdir);
processes.add(p);
} catch (IOException e) {
LOGGER.log(Level.WARNING, "Failed to load promotion process in "+subdir,e);
}
}
}

Expand Down Expand Up @@ -303,4 +301,6 @@ public JobPropertyImpl newInstance(StaplerRequest req, JSONObject json) throws D
}
}
}

private static final Logger LOGGER = Logger.getLogger(JobPropertyImpl.class.getName());
}

0 comments on commit cd41ec1

Please sign in to comment.