Skip to content

Multiple error strategies for the same process #2130

Answered by davidmasp
davidmasp asked this question in Q&A
Discussion options

You must be logged in to vote

Okay, I managed to make it work using a if/else statement. Something like this:

  errorStrategy {
    if (task.exitStatus == 124){
      'retry'
    } else if (task.exitStatus == 123) {
      'ignore'
    } else {
      'terminate'
      }
    }

A full reproducible version of this should be available here

EDIT:
As suggested by @abhi18av I have tested this solution which is more elegant and also works fine!

errorStrategy { task.exitStatus == 124 ? 'retry' :  (task.exitStatus == 123 ? 'ignore' : 'terminate') }

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
2 replies
@davidmasp
Comment options

@abhi18av
Comment options

Comment options

You must be logged in to vote
1 reply
@pditommaso
Comment options

Answer selected by davidmasp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants