diff --git a/vars/dockerExecuteOnKubernetes.groovy b/vars/dockerExecuteOnKubernetes.groovy index 0f25ad36a..3ee7f9a06 100644 --- a/vars/dockerExecuteOnKubernetes.groovy +++ b/vars/dockerExecuteOnKubernetes.groovy @@ -415,13 +415,14 @@ private Map getSecurityContext(Map config) { private void unstashWorkspace(config, prefix) { try { unstash "${prefix}-${config.uniqueId}" - echo "invalidate stash ${prefix}-${config.uniqueId}" - stash name: "${prefix}-${config.uniqueId}", excludes: '**/*', allowEmpty: true } catch (AbortException | IOException e) { - echo "${e.getMessage()}" + echo "${e.getMessage()}\n${e.getCause()}" } catch (Throwable e) { echo "Unstash workspace failed with throwable ${e.getMessage()}" throw e + } finally { + echo "invalidate stash ${prefix}-${config.uniqueId}" + stash name: "${prefix}-${config.uniqueId}", excludes: '**/*', allowEmpty: true } }