Skip to content

Instantly share code, notes, and snippets.

@chgeuer
Created December 4, 2012 17:35
Show Gist options
  • Select an option

  • Save chgeuer/4206640 to your computer and use it in GitHub Desktop.

Select an option

Save chgeuer/4206640 to your computer and use it in GitHub Desktop.
Display Exceptions in Windows 8
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