Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make ExceptionCause public #48

Closed
wants to merge 1 commit into from

Conversation

pgmillon
Copy link

@pgmillon pgmillon commented Nov 6, 2019

Useful to cleanly break from a retry wrapper, keeping the root exception:

retry(50) {
  try {
    if(!ec2GetTags(instanceId).containsKey('slave_configuration')) {
      sleep 30
      throw new Exception('Missing tag slave_configuration on instance')
    }
  } catch (AmazonServiceException e) {
    throw new FlowInterruptedException(Result.FAILURE, new ExceptionCause(e) {})
  }
}

Copy link
Member

@jglick jglick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would rather move this to Jenkins core, as noted in Javadoc.

Anyway the script mentioned in the PR description is not sandbox-safe, so we do not want to encourage such idioms.

@jglick
Copy link
Member

jglick commented Jul 22, 2022

(also see #124)

@jglick jglick closed this Jul 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants