title: C# try catch continue execution
body: <p>I have a question that might seem fairly simple (of course if you know the answer).</p>
  
  <p>A certain function I have calls another function but I want to continue execution from the caller even though the callee has thrown an exception.  Let me give you an example:</p>
  
  <pre><code>something function1()
  {
      try
      {
          //some code
          int idNumber = function2();
          //other code that need to execute even if function2 fails
          return something;
      }
      catch(Exception e)
      {//... perhaps something here}
  }
  </code></pre>
  
  <p><strong>EDIT: function1 also has a return statement so nothing can in fact crash on the way</strong></p>
  
  <p>In function2 I need to do stuff but I only need to log if anything fails, example:</p>
  
  <pre><code>int function2()
  {
      try
      {
          //dostuff
      }
      catch(Exception e)
      {
          //Log stuff to db
      }
  }
  </code></pre>
  
  <p><strong>ok, now my question is, what should I do if I wanted to continue execution in function1 even if function 2 throws an error?</strong></p>
  
  <p><em>Sometimes I mix up if I should do throw; or throw e; or throw nothing at all (leave catch block empty)</em></p>