title: How to correctly rethrow an exception of task already in faulted state?
body: <p>I have a synchronous method which, amongst other things, checks the status of a pending task and rethrows its exception, if any:</p>
  
  <pre><code>void Test(Task task)
  {
      // ...
      if (task.IsFaulted)
          throw task.Exception;
      // ...
  }
  </code></pre>
  
  <p>This doesn't propagate the exception stack trace information and is debugger-unfriendly.</p>
  
  <p>Now, if the <code>Test</code> was <code>async</code>, it would not be as simple and natural as this:</p>
  
  <pre><code>async Task Test(Task task)
  {
      // ...
      if (task.IsFaulted)
          await task; // rethrow immediately and correctly
      // ...
  }
  </code></pre>
  
  <p><strong>Question: how to do it right for a synchronous method?</strong> I have come up with this but I do not like it:</p>
  
  <pre><code>void Test(Task task)
  {
      // ...
      if (task.IsFaulted)
          new Action(async () =&gt; await task)();
      // ...
  }
  </code></pre>