Skip to content

Instantly share code, notes, and snippets.

@kzu
Created September 24, 2023 22:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kzu/400186f5f0ca5b06c75f063e6b2d6172 to your computer and use it in GitHub Desktop.
Save kzu/400186f5f0ca5b06c75f063e6b2d6172 to your computer and use it in GitHub Desktop.
Try to inspect variables when the exception is thrown
using Spectre.Console;
Console.WriteLine("Hello, World!");
for (int i = 0; i < 50; i++)
{
var result = await AnsiConsole.Status().StartAsync("Processing", async c =>
{
await Task.Delay(i);
if (i == 2)
throw new NotSupportedException();
return i * 2;
});
AnsiConsole.WriteLine(result);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment