title: Global Error Handling in ASP.NET Web API 2
body: <p>Preamble: This question is different from <a href="https://stackoverflow.com/questions/23322943/exception-handling-in-asp-net-web-api-2">"Exception Handling in ASP.net Web API"</a> as the OP was looking for custom Error Handling, not global handling. It also differs from other earlier questions that were answered, as those were for earlier versions of Web API, not version 2. Also note I am going to self answer this question. It took quite some searching to find the correct answer.</p>
  
  <p>The question is: How do I globally handle errors in Web API 2.0?  The error handling I have set up for MVC does not get activated for web api calls and I need to generically handle any error that is thrown so that relevant error information is returned to the client.</p>