Last active
August 29, 2015 13:57
-
-
Save ProdigySim/9511953 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
| using System; | |
| using System.Runtime.CompilerServices; | |
| using System.Threading.Tasks; | |
| public class Class1 | |
| { | |
| static Class1() | |
| { | |
| DoThing(); | |
| } | |
| static async void DoThing() | |
| { | |
| Console.WriteLine("Doing something"); | |
| await ThrowingTask(); | |
| Console.WriteLine("Done with task!"); | |
| } | |
| static async Task ThrowingTask() | |
| { | |
| await Task.Delay(100); | |
| throw new Exception("Oh my gosh an exception!"); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment