Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save compiler-errors/259c4fdc796017ef700ad400585381ea to your computer and use it in GitHub Desktop.

Select an option

Save compiler-errors/259c4fdc796017ef700ad400585381ea to your computer and use it in GitHub Desktop.
class Program
{
static async Task Main(string[] args)
{
try
{
MyAsyncMethod();
}
catch(Exception ex)
{
Console.WriteLine("Show my exception:");
Console.Write(ex.Message);
}
}
private static async Task MyAsyncMethod()
{
Console.writeLine("Throwing an exception now!");
throw new ArgumentException("Exception from MyAsyncMethod");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment