title: Which is better to catch all exceptions except given types: catch and rethrow or catch when?
body: <p>If I wanted to catch all exceptions except for given types, and those specific types would be re-thrown to be caught in a higher context, would it be better to do:</p>
  
  <pre><code>try
  {
      //Code that might throw an exception
  }
  //Catch exceptions to be handled in this context
  catch (Exception ex) when (!IsExcludedException(ex))
  {
      //Handle leftover exceptions
  }
  </code></pre>
  
  <p>Or would it be better to do:</p>
  
  <pre><code>try
  {
      //Code that might throw an exception
  }
  catch (SpecificException)
  {
      throw;
  }
  //Catch exceptions to be handled in this context
  catch (Exception ex)
  {
      //Handle leftover exceptions
  }
  </code></pre>
  
  <p>Or does it not really matter? Is there a better way?</p>