Jesse Glick commented on Improvement JENKINS-26034

if I want to record the fact a particular branch failed

You mean, beyond the build log and any flow graph visualizations that show this information, you want to base some decision for the remainder of the flow on which part failed, rather than having the whole build abort then and there. You could do something like

def oneErr, twoErr
try {
  parallel one: {
    try {
      …
    } catch (x) {
      _oneErr_ = x
      throw x // or anything for that matter
    }
  }, two: {
    try {
      …
    } catch (x) {
      twoErr = x
      throw x
    }
  }
} catch (x) {
  if (oneErr) {
    …
  } else if (twoErr) {
    …
  } else {
    // something else went wrong, die
    throw x
  }
}

Perhaps not the most concise idiom, but the purpose is probably apparent to anyone reading it, and it is not hard to see how you could customize some aspects of the behavior.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

--
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to