title: ServiceStack: how to deal with errors?
body: <p>I'm using ServiceStack with great results so far, except that dealing with errors is seemingly tricky. If something goes wrong during serialization of a message (because I forgot to add a default constructor to the message for example) all the client gets back is a message that the server had an internal error and a status code of 500. Adding a listener to the <code>HttpApplication.Error</code> event in the Global.asax doesn't work as it never gets hit. Neither does <code>Application_Error</code>. Not only is this insufficient for end user scenarios, it makes debugging these errors very cumbersome as the only way to find out what went wrong is this ugly expression in the Quick Watch:</p>
  
  <pre><code>Encoding.Default.GetString( ((System.IO.MemoryStream)((SyncMemoryStream)((System.Net.HttpWebResponse)(((WebException)ex).Response)).ResponseStream))._buffer)
  </code></pre>
  
  <p>What I'd like is catch any and all errors on the server side (be it serialization by ServiceStack, or errors on my services) and add the required information to an <code>Errors</code> collection that all my message types have. </p>