title: How to catch Exception within a Task in Xamarin.iOS / Mono?
body: <p>Xamarin.iOS 6.2.1, Xamarin Studio 4</p>
  
  <p>I have this piece of code in <code>ViewDidAppear()</code>:</p>
  
  <pre><code>this.refreshTask = Task.Factory.StartNew(() =&gt; this.RefreshContent());
  
  try
  {
      this.refreshTask.Wait();
  }
  catch(AggregateException aggEx)
  {
      aggEx.Handle(x =&gt; false);
  }
  </code></pre>
  
  <p>The method <code>RefreshContent()</code> causes an <code>IndexOutOfBoundsException</code> while accessing an array. I can see this if I run the method directly.
  If I run it in the Task, as above, the application does not fail and I end up with an empty tableview. According to this article: <a href="http://msdn.microsoft.com/en-us/library/dd537614.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/dd537614.aspx</a> the code above should handle the exception.
  However, the <code>AggregateException</code> is never triggered.</p>
  
  <p>What am I doing wrong here? Or is it a bug in Xamarin.iOS / Mono?</p>