title: Why do try blocks need a catch
body: <p>I have this code :</p>
  <pre class="lang-cs prettyprint-override"><code>try 
  {
      result.FirstName = nodes[myIdx]
          .Attributes[&quot;ows_FirstName&quot;].Value;
  } 
  catch { }
  </code></pre>
  <p>Now I don't know prior to invoking this call if the attribute I am looking for exists (<em>Good ol sharepoint</em>).</p>
  <p>As a result the only linear way I can write the code I am looking to create is as such.</p>
  <pre class="lang-cs prettyprint-override"><code>try 
  {
      result.FirstName = nodes[myIdx]
          .Attributes[&quot;ows_FirstName&quot;]
          .Value;
  } 
  catch { }
  
  try 
  {
      result.LastName = nodes[myIdx]
          .Attributes[&quot;ows_LastName&quot;]
          .Value;
  } 
  catch { }
  </code></pre>
  <p>Now I have no use for the catch section of this code and end up with a huge amount of lines that are completely redundant.</p>
  <p>Why couldn't I just do</p>
  <pre class="lang-cs prettyprint-override"><code>try 
  {
      result.FirstName = nodes[myIdx]
          .Attributes[&quot;ows_FirstName&quot;]
          .Value;
  }
  </code></pre>
  <p>So why are we explicitly forced to declare a catch block even when it isn't handled? I'm sure there is a good reason but can't work it out.</p>
  <p>I know the importance of exception handling, but here is simply nothing exceptional about the exception and nothing I can do (nor need to do) to fix the behavior.</p>