title: How to catch all exceptions in Web API 2?
body: <p>I'm writing a RESTful API in Web API and I'm not sure how to handle errors effectively.  I want the API to return JSON, and it needs to consist of the exact same format every single time - even on errors.  Here are a couple of examples of what a successful and a failed response might look like.</p>
  
  <p>Success:</p>
  
  <pre><code>{
      Status: 0,
      Message: "Success",
      Data: {...}
  }
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>{
      Status: 1,
      Message: "An error occurred!",
      Data: null
  }
  </code></pre>
  
  <p>If there is an exception - <em>any</em> exception at all, I want to return a response that is formed like the second one.  What is the foolproof way to do this, so that no exceptions are left unhandled?</p>