Considering the following contrived Jenkinsfile:
node {
try {
echo "I'm too cool to stash"
1 / 0
}
finally {
unstash 'invalid'
echo "Did you see the exception?"
}
}
The exception thrown in the try block will never ever get printed in the Console Output. This is pretty frustrating as it hides the original error from me :'(, see below:
Started by user admin
Replayed #3
[Pipeline] node
Running on master in /var/jenkins_home/workspace/foo
[Pipeline] {
[Pipeline] echo
I'm too cool to stash
[Pipeline] unstash
[Pipeline] }
[Pipeline] [Pipeline] End of Pipeline
ERROR: No such saved stash ‘invalid’
Finished: FAILURE