Jenkins 异常捕获

Jenkins 异常捕获,jenkins,groovy,sonarqube,devops,sonarqube-scan,Jenkins,Groovy,Sonarqube,Devops,Sonarqube Scan,您好,到目前为止,我使用这个规则 用于捕获与SonarQube代码检查无关的异常。 你们能建议我应该包括的常见异常,如果出于未知原因而等待质量门,那么除了代码 try { steps.timeout(time: 10, unit: 'MINUTES') { steps.waitForQualityGate abortPipeline: true } } catch (IllegalStateException exception) { state.s

您好,到目前为止,我使用这个规则 用于捕获与SonarQube代码检查无关的异常。 你们能建议我应该包括的常见异常,如果出于未知原因而等待质量门,那么除了代码

   try {
        steps.timeout(time: 10, unit: 'MINUTES') { steps.waitForQualityGate abortPipeline: true }
    } catch (IllegalStateException exception) {
        state.setPipelineErrorMessage("${exception}")
        steps.unstable('Not a code issue. Build will be Unstable!')
    

我不确定您到底在问什么,但是我们在超时块周围使用的catch块正在检查“FlowInterruptedException”(org.jenkinsci.plugins.workflow.steps.FlowInterruptedException)。这就是计时器过期时抛出的内容