title: Global error handling in ASP.NET
body: <p>Is there anything wrong with catching errors in an ASP.NET application globally (eg: Global.asax)? I have viewed the question <a href="https://stackoverflow.com/questions/155203/good-error-handling-practice">Good error handling practice</a> and it doesn't really say too much about this.</p>
  
  <p>My experience has been excluding some very specific circumstances (such as transactions) most of the ASP.NET applications we are writing are along the lines of </p>
  
  <pre><code>void ButtonEventHandler(object sender, EventArgs e) {
      Page.Validate();
      if (Page.IsValid) {
          //Do a database insert or update thru relevant datalayers.
          //If its a transaction then we rollback internally and rethrow
          //the exception.
      }
  }
  </code></pre>
  
  <p>Why not just have a global exception handler? Usually (at this point) the only thing I can do is abort the operation gracefully and tell the user to try again.</p>