title: Web API throw custom exception back to client
body: <p>Currently, I'm doing the following to send error messages back to the client:</p>
  
  <pre><code>HttpResponseMessage message = new HttpResponseMessage(HttpStatusCode.Forbidden)
  {
      ReasonPhrase = "No rights to access this resource",
  };
  
  throw new HttpResponseException(message);
  </code></pre>
  
  <p>However, I would like to improve the response further by sending back custom exceptions. So I can have something like this:</p>
  
  <pre><code>public class MyAppException : Exception {}
  
  public class NoRightsException : MyAppException {}
  public class SaveException : MyAppException {}    
  //etc...
  </code></pre>
  
  <p>All my exceptions will be in a separate assembly that will be reference by both the server and the client.</p>
  
  <p>How is the best to return these exceptions to the client and how will the client have to check whether the response is my custom exception, another exception or simply a text message?</p>