title: Catching exceptions from Asynchronous HttpWebRequest Calls in a Task
body: <p>How would i catch the exception in this method below? </p>
  
  <pre><code>    private static Task&lt;string&gt; MakeAsyncRequest(string url)
      {
          if (!url.Contains("http"))
              url = "http://" + url;
  
          HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
          request.UserAgent = "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)";
          request.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8";
          request.Method = "GET";
          request.KeepAlive = false;
          request.ProtocolVersion = HttpVersion.Version10;
  
          Task&lt;WebResponse&gt; task = Task.Factory.FromAsync(
          request.BeginGetResponse,
          asyncResult =&gt; request.EndGetResponse(asyncResult),
          (object)null);
  
          return task.ContinueWith(t =&gt; FinishWebRequest(t.Result));
  
      }
  </code></pre>
  
  <p>The specific place i am getting 404, 403, etc errors is:</p>
  
  <pre><code>Task&lt;WebResponse&gt; task = Task.Factory.FromAsync(
              request.BeginGetResponse,
              asyncResult =&gt; request.EndGetResponse(asyncResult),
              (object)null);
  </code></pre>
  
  <p>I cant figure out how to handle them</p>