Created
September 24, 2023 22:39
-
-
Save kzu/400186f5f0ca5b06c75f063e6b2d6172 to your computer and use it in GitHub Desktop.
Try to inspect variables when the exception is thrown
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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