override fun getRunResult()

in plugin-rust-agent/src/main/kotlin/jetbrains/buildServer/rust/CargoRunnerBuildService.kt [48:66]


    override fun getRunResult(exitCode: Int): BuildFinishedStatus {
        if (exitCode == 0) {
            return BuildFinishedStatus.FINISHED_SUCCESS
        }

        val commandName = runnerParameters[CargoConstants.PARAM_COMMAND]
        val argumentsProvider = myArgumentsProviders[commandName]
        if (argumentsProvider == null) {
            val buildException = RunBuildException("Unable to construct arguments for cargo command $commandName")
            buildException.isLogStacktrace = false
            throw buildException
        }

        return if (argumentsProvider.shouldFailBuildIfCommandFailed()) {
            BuildFinishedStatus.FINISHED_FAILED
        } else {
            BuildFinishedStatus.FINISHED_SUCCESS
        }
    }