The only time I have seen this is if the downstream job never actually starts…e.g. Groovy error. A job that fails a step will return a handle.
So I have never had to do defensive programming around this. I could always fix the problem. From: jenkinsci-users@googlegroups.com [mailto:jenkinsci-users@googlegroups.com] On Behalf Of Adam Daughterson Sent: Monday, August 10, 2015 1:38 PM To: Jenkins Users Subject: Chicken-Egg issue with job references in Build Flow Howdy Group, I've got a build flow in which things can, and do go wrong. When things go wrong with a downstream job I'm running, and I've created a reference to the build, the reference winds up being null since an exception is thrown so far downstream that the build() step is never completed, thus no handy reference to the build. Is there any way I can tickle the DSL to wait to throw that exception until I return a reference to the failed build, so I can mine it for useful info after it fails? In pseudocode: parallel { def passingJob = build("SomePassingJob") // Works for passingJob, but not for failingJob since the exception prevents build() from returning valid reference postProcessing(passingJob) def jobShouldFail = build("SomeFailingJob") postProcessing(failingJob) } def SomePostProcessing(def job) { println job.getProject().getName() } Anyone have any suggestions as to what I can do here? The exception thrown is really devoid of anything useful, and I'm half-tempted to modify the exception handler in the Build Flow plugin to stuff the reference to the job into the thrown exception. As always, all help is appreciated. Adam -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+unsubscr...@googlegroups.com<mailto:jenkinsci-users+unsubscr...@googlegroups.com>. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/81ebeeb2-7249-447a-afe7-5ed01d4bd610%40googlegroups.com<https://groups.google.com/d/msgid/jenkinsci-users/81ebeeb2-7249-447a-afe7-5ed01d4bd610%40googlegroups.com?utm_medium=email&utm_source=footer>. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/6C6EE445A6F6CE4E8A0FFB51B071A4E2D8653F2D%40AMERMBX02.PERKINELMER.NET. For more options, visit https://groups.google.com/d/optout.