title: determine if exception is rethrowable
body: <p>I have 2 functions:</p>
  
  <pre><code>public void WithdrawMoney()
  {
      //Take money from bank account
      //Exceptions abort the operation and are printed
      //Rethrow exception if called by TransferMoney()
  }
  
  public void TransferMoney()
  {
      //Take money from one account and only deposit on another account if no exceptions were caught in WithdrawMoney()
      WithdrawMoney(); 
      DepositMoney();     
  }
  </code></pre>
  
  <p>What I want is to be able to rethrow an exception that occured in <strong>WithdrawMoney()</strong>, only if it was called by <strong>TransferMoney()</strong>. If I just want to withdraw money from an account, the exception must be handled, but does not have to be rethrown as it was not called by another method.</p>
  
  <p>Besides working with bools, there is another solution that comes to my mind. I could look into the stacktrace, see if <strong>TransferMoney()</strong> called <strong>WithdrawMoney()</strong> and only rethrow the exception if it did. Or is there a way to see if an exception occured in a method?</p>
  
  <p>I just want to know if you can check whether an exception is throwable in a catch block before throwing it. If I always throw it, the exception will be unhandled when I just call <strong>WithdrawMoney()</strong> directly.</p>