title: Exception Handling in UWP
body: <p>I've got an Async method that calls an API to retrieve a JSON via <code>HttpClient</code> with the following code block-</p>
  
  <pre><code>//Assemble the url
  string url = "https:someapi.com";
  //Call API
  var http = new HttpClient();
  var response = new HttpResponseMessage();
  try
    {
      response = await http.GetAsync(url);
    }
  catch (HttpRequestException exception)
    {
     //The server name or address could not be resolved
     var dialog = new MessageDialog("The server name or address could not be resolved!");
     dialog.Title = "API Response";
     dialog.Commands.Add(new UICommand { Label = "Ok", Id = 0 });
     var res = await dialog.ShowAsync();
     if ((int) res.Id == 0)
     {
      exception.ExceptionHandled = true;// Cant' do this!
     }
    }
  return result;
  </code></pre>
  
  <p>This is for an app development. I was trying to make to app more robust so that while there is no internet or data connection the app should should return that it can't call to the API service and show an error rather than crashing. But I just can't find an way to set the <code>ExceptionHandled</code> property to <code>true</code>. Is there a better way to do this?
  P.S. The app crashes and debugger breaks when <code>Ok</code> button is clicked</p>