jenkinsci / jenkinsci/workflow-basic-steps-plugin
[JENKINS-56180] unstahing always success even if stash failed
- Dominant language
- Java
- Stars
- 73
- Forks
- 129
- PR merge metrics
- No merged PRs in 30d
Description
No matter if stash succed or not unstash always pass.
I want to stash file but I dont know if it exists. If file exists everything goes well my_jar is saved and I can unstash it. But... if file doesnt exists it goes to catch() section and I guess that unstash also should go to catch() section but it's not happening. Instead of it unstash return success (without any files). It means that during stash section "my_jar" label is created and unstash recognize it as stashed file.
(NODE1){
try {
stash includes: 'some_jar.jar', name: 'my_jar'
}
catch(e){
println(e.toString())
}
}
.
.
.
(NODE2){
try {
unstash 'my_jar'
}
catch (e) {
println(e.toString())
//DO SOMETING
}
---
Originally reported by tomkoz, imported from: unstahing always success even if stash failed
Raw content of original issue
No matter if stash succed or not unstash always pass.
I want to stash file but I dont know if it exists. If file exists everything goes well my_jar is saved and I can unstash it. But... if file doesnt exists it goes to catch() section and I guess that unstash also should go to catch() section but it's not happening. Instead of it unstash return success (without any files). It means that during stash section "my_jar" label is created and unstash recognize it as stashed file.
(NODE1){
try {
stash includes: 'some_jar.jar', name: 'my_jar'
}
catch(e){
println(e.toString())
}
}
.
.
.
(NODE2){
try {
unstash 'my_jar'
}
catch (e) {
println(e.toString())
//DO SOMETING
}
Contributor guide
Assessment
This issue has not been assessed yet.