SonarQube异常捕获

时间:2020-10-26 09:09:05

标签: jenkins groovy sonarqube devops sonarqube-scan

您好,到目前为止,我使用此规则 用于捕获与SonarQube代码检查无关的异常。 大家能否建议常见的例外情况,如果WaitforQuality门出于未知原因而不是代码,则应包括在内...

   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!')
    

1 个答案:

答案 0 :(得分:0)

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

相关问题