diff --git a/csharp/extractor/Semmle.Extraction.CSharp/Extractor/Extractor.cs b/csharp/extractor/Semmle.Extraction.CSharp/Extractor/Extractor.cs index 8eb16cb6e46a..610d8065711a 100644 --- a/csharp/extractor/Semmle.Extraction.CSharp/Extractor/Extractor.cs +++ b/csharp/extractor/Semmle.Extraction.CSharp/Extractor/Extractor.cs @@ -120,7 +120,7 @@ public static ExitCode Run(string[] args) }; var compilerCalls = BinaryLogUtil.ReadAllCompilerCalls(fileStream, predicate); - var exitCode = ExitCode.Ok; + var allFailed = true; foreach (var compilerCall in compilerCalls) { var diagnosticName = compilerCall.GetDiagnosticName(); @@ -130,13 +130,13 @@ public static ExitCode Run(string[] args) compilerCallOptions.CompilerArguments.AddRange(compilerCall.GetArguments()); logger.LogInfo($"Running extractor on arguments from binary log. Processing {diagnosticName}."); var ec = Run(compilerCallOptions, logger); - if (ec != ExitCode.Ok) + if (ec != ExitCode.Failed) { - exitCode = ec; + allFailed &= false; } } - return exitCode; + return allFailed ? ExitCode.Failed : ExitCode.Ok; } else {