title: Suppress warning on unused exception variable in C#
body: <p>I have this code:</p>
  
  <pre><code>try {
      someMethod();
  } catch (XYZException e) {
      // do something without using e
  }
  </code></pre>
  
  <p>Doing this will give me a warning about declaring but never using <code>e</code>, which I hate. However, I also don't want to use a <code>catch</code> clause without that variable, because then it will catch all exceptions, not just <code>XYZException</code>s. This seems like a fairly often occurring pattern. I know I can use <code>#pragma warning disable 0168</code> to suppress the warning, but I don't really find that a very elegant solution. Is there a better way?</p>