且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Jenkins管道脚本中的Try-catch块

更新时间:2023-11-29 14:43:28

您使用指定管道的声明式样式,因此您不得使用try / catch(用于脚本管道),但是发布部分。请参阅: https://jenkins.io/doc/book/pipeline/syntax/ #后期条件

Your using the declarative style of specifying your pipeline, so you must not use the try/catch (which is for Scripted Pipelines), but the post section. See: https://jenkins.io/doc/book/pipeline/syntax/#post-conditions