Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -244,12 +244,20 @@ private static async Task<ExitCode> Run(Configuration config)
}

// return nonzero status code if there are stress errors
return client?.TotalErrorCount == 0 ? ExitCode.Success : ExitCode.StressError;
return client?.TotalErrorCount == 0 && s_unobservedExceptions.Count == 0 ? ExitCode.Success : ExitCode.StressError;
}

private static void PrintUnobservedExceptions()
{
if (s_unobservedExceptions.Count == 0)
{
Console.WriteLine("No unobserved exceptions detected.");
return;
}

Console.ForegroundColor = ConsoleColor.DarkRed;
Console.WriteLine($"Detected {s_unobservedExceptions.Count} unobserved exceptions:");
Console.ResetColor();

int i = 1;
foreach (KeyValuePair<string, int> kv in s_unobservedExceptions.OrderByDescending(p => p.Value))
Expand Down
Loading