0

I have the following problem. I have a command that unfortunately only works from time to time in powershell. Sometimes an error comes sometimes it runs through.

Now I am looking for an option in the declarative Jenkins pipeline to execute a step, if this step fails it should execute another command.

However, if the first command runs through, skip the second command, because it is then no longer necessary.

Unfortunately I don't know at all how to implement this.

I have thought about catch error. I have thought about if else .

1 Answer 1

0

Maybe what you need it's already resolved here. I've been working with try/catch because I had same issues of unstable executions and works like a charm. Try-catch block in Jenkins pipeline script

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.