Skip to content

Commit

Permalink
Catching all exceptions in Main to ensure the log is properly flushed…
Browse files Browse the repository at this point in the history
… before exiting the process.
  • Loading branch information
CIPop committed May 13, 2020
1 parent e5aa9ea commit fac5e9e
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions e2e/stress/IoTClientPerf/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -248,13 +248,16 @@ public static int Main(string[] args)
{
ret = runner.RunTestAsync().GetAwaiter().GetResult();
}
finally
catch (Exception ex)
{
Console.Write("Writing output . . . ");
resultWriter.FlushAsync().GetAwaiter().GetResult();
Console.WriteLine("OK");
Console.WriteLine(ex);
ret = -1;
}

Console.Write("Writing output . . . ");
resultWriter.FlushAsync().GetAwaiter().GetResult();
Console.WriteLine("OK");

if (ret == 0)
{
Console.WriteLine("Test PASSED.");
Expand Down

0 comments on commit fac5e9e

Please sign in to comment.