Skip to content

Commit 40970db

Browse files
authored
Merge pull request #51 from jglick/onCheckout
Tolerate `RuntimeException` from `SCMListener.onCheckout`
2 parents 2336bd3 + 3f97531 commit 40970db

File tree

1 file changed

+9
-1
lines changed
  • src/main/java/org/jenkinsci/plugins/workflow/steps/scm

1 file changed

+9
-1
lines changed

src/main/java/org/jenkinsci/plugins/workflow/steps/scm/SCMStep.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@
3939
import java.util.Map;
4040
import java.util.Set;
4141
import java.util.TreeMap;
42+
import java.util.logging.Level;
43+
import java.util.logging.Logger;
4244
import javax.annotation.Nonnull;
4345
import org.jenkinsci.plugins.workflow.steps.Step;
4446
import org.jenkinsci.plugins.workflow.steps.StepContext;
@@ -52,6 +54,8 @@
5254
*/
5355
public abstract class SCMStep extends Step {
5456

57+
private static final Logger LOGGER = Logger.getLogger(SCMStep.class.getName());
58+
5559
private boolean poll = true;
5660
private boolean changelog = true;
5761

@@ -147,7 +151,11 @@ public final void checkout(Run<?,?> run, FilePath workspace, TaskListener listen
147151
}
148152
}
149153
for (SCMListener l : SCMListener.all()) {
150-
l.onCheckout(run, scm, workspace, listener, changelogFile, pollingBaseline);
154+
try {
155+
l.onCheckout(run, scm, workspace, listener, changelogFile, pollingBaseline);
156+
} catch (RuntimeException x) {
157+
LOGGER.log(Level.WARNING, null, x);
158+
}
151159
}
152160
scm.postCheckout(run, launcher, workspace, listener);
153161
} catch (Exception e) {

0 commit comments

Comments
 (0)