Skip to content

Commit

Permalink
Tolerate RuntimeException from SCMListener.onCheckout
Browse files Browse the repository at this point in the history
  • Loading branch information
jglick committed May 6, 2021
1 parent 2336bd3 commit 3f97531
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.annotation.Nonnull;
import org.jenkinsci.plugins.workflow.steps.Step;
import org.jenkinsci.plugins.workflow.steps.StepContext;
Expand All @@ -52,6 +54,8 @@
*/
public abstract class SCMStep extends Step {

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

private boolean poll = true;
private boolean changelog = true;

Expand Down Expand Up @@ -147,7 +151,11 @@ public final void checkout(Run<?,?> run, FilePath workspace, TaskListener listen
}
}
for (SCMListener l : SCMListener.all()) {
l.onCheckout(run, scm, workspace, listener, changelogFile, pollingBaseline);
try {
l.onCheckout(run, scm, workspace, listener, changelogFile, pollingBaseline);
} catch (RuntimeException x) {
LOGGER.log(Level.WARNING, null, x);
}
}
scm.postCheckout(run, launcher, workspace, listener);
} catch (Exception e) {
Expand Down

0 comments on commit 3f97531

Please sign in to comment.