Comment 2 for bug 1270309

Revision history for this message
Gene Pavlovsky (gene-pavlovsky) wrote :

You can handle this:

try {
  ... // Build steps
}
catch (java.lang.InterruptedException err) {
  currentBuild.result = 'ABORTED' // Mark the build as aborted
}
catch (err) {
  error err.message // Mark the build as failed
}
finally {
  ... // Clean up steps, build result reporting etc...
  cleanWs(notFailBuild: true)
}

The only thing, is your build steps include nested try/catch blocks, you have to also catch the InterruptedException there and propagate it to this outer catch...