I am trying to do some loop with sshPublisher.
I have to catch failed iteration from the loop.
For example,
array = [some configs]
array.each {
sshPublisher ( exec some command )
if ( error occurred from sshPublisher) { do something }
}
I found that if an error occurred in sshPublisher, it changes currentBuild.result to UNSTABLE,
So I tried for using currentBuild.result, but it can't be set from UNSTABLE to SUCCESS, so I can't use this.
Is there anyway to get error code or something from the sshPublisher()?