title: Why can't I catch an exception from async code?
body: <p>Everywhere I read it says the following code should work, but it doesn't. </p>
  
  <pre><code>public async Task DoSomething(int x)
  {
     try
     {
        // Asynchronous implementation.
        await Task.Run(() =&gt; {
        throw new Exception();
        x++;
        });
     }
     catch (Exception ex)
     {
        // Handle exceptions ?
     }
  }
  </code></pre>
  
  <p>That said, I'm not catching anything and get an "unhandled exception" originating at the 'throw' line. I'm clueless here.</p>