Created
October 18, 2021 21:45
-
-
Save compiler-errors/259c4fdc796017ef700ad400585381ea to your computer and use it in GitHub Desktop.
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
| 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