Created
December 4, 2012 17:35
-
-
Save chgeuer/4206640 to your computer and use it in GitHub Desktop.
Display Exceptions in Windows 8
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
| private async void showPotentialException(Func<System.Threading.Tasks.Task> a) | |
| { | |
| string message = null; | |
| try | |
| { | |
| await a(); | |
| } | |
| catch (Exception ex) | |
| { | |
| message = ex.Message; | |
| } | |
| if (message != null) | |
| { | |
| var dialog = new MessageDialog(message); | |
| dialog.Commands.Add(new UICommand("OK")); | |
| await dialog.ShowAsync(); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment