title: ServiceStack: Errors not serialized to responsestatus
body: <p>Iam new to service stack and have been strugling for hours, trying to make servicestak work for me. For now the major show stopper is that i cann't make the exception part work. I registered all plugins by the book and services work for both REST, Soap, CSV, XML and JSV. The project contains 4 basic test methods for crud operations on a customer object. When an error is thrown i do not get the expected error: ResponseStatus is not set and a generel error is generated. Can some one please help me find out why?</p>
  
  <p><a href="https://dl.dropbox.com/u/101619220/TestingServiceStack.zip" rel="nofollow">https://dl.dropbox.com/u/101619220/TestingServiceStack.zip</a></p>
  
  <p>EDIT: Thanks for comment :)</p>
  
  <p>I created a simple AppHost file:</p>
  
  <p>namespace TestingServiceStack
  {
      public class AppHost : AppHostBase
      {
          public AppHost()
              : base("StarterTemplate ASP.NET Host", typeof(CustomersService).Assembly)
          {
          }</p>
  
  <pre><code>    public override void Configure(Container container)
      {
          Plugins.Add(new ValidationFeature());
          Plugins.Add(new RequestLogsFeature());
  
          SetConfig(new EndpointHostConfig
              {
                  DebugMode = true, //Enable StackTraces in development
              });
  
          LogManager.LogFactory = new Log4NetFactory(true);
  
          JsConfig.EmitCamelCaseNames = true;
          JsConfig.DateHandler = JsonDateHandler.ISO8601;
  
          Routes.Add&lt;GetCustomers&gt;("/customers", "GET")
                .Add&lt;GetCustomers&gt;("/customers/{Id}", "GET")
                .Add&lt;AddCustomer&gt;("/customers", "POST")
                .Add&lt;UpdateCustomer&gt;("/customers/{Id}", "PUT")
                .Add&lt;DeleteCustomer&gt;("/customers/{Id}", "DELETE");
      }
  
      public static void Start()
      {
          new AppHost().Init();
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>And a service:</p>
  
  <p>namespace TestingServiceStack
  {
      public class CustomersService : Service
      {
          #region Logging</p>
  
  <pre><code>    private static readonly ILog Log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
  
      #endregion
  
      public object Any(GetCustomers request)
      {
          GetCustomersResponse response = null;
          try
          {
              if (request.Id != "0")
                  throw HttpError.NotFound("Id {0} throws error".Fmt(request.Id));
  
              response = new GetCustomersResponse {Id = request.Id ?? "notset", Name = "GetCustomers"};
          }
          catch (Exception ex)
          {
              Log.Error(base.RequestContext.Get&lt;IHttpRequest&gt;(), ex);
              throw;
          }
  
          return response;
      }
  
      public object Any(AddCustomer request)
      {
          return new AddCustomerResponse {Id = request.Id, Name = "AddCustomer"};
      }
  
      public object Any(UpdateCustomer request)
      {
          return new UpdateCustomerResponse {Id = request.Id, Name = request.Name};
      }
  
      public object Any(DeleteCustomer request)
      {
          return new DeleteCustomerResponse {Id = request.Id, Name = "DeleteCustomer"};
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>And the exchanged objects are:</p>
  
  <p>using System.Runtime.Serialization;
  using ServiceStack.ServiceInterface.ServiceModel;</p>
  
  <p>namespace TestingServiceStack
  {
      [DataContract]
      public class GetCustomers
      {
          [DataMember]
          public string Id { get; set; }
      }</p>
  
  <pre><code>[DataContract]
  public class UpdateCustomer
  {
      [DataMember]
      public string Id { get; set; }
  
      [DataMember]
      public string Name { get; set; }
  }
  
  [DataContract]
  public class AddCustomer
  {
      [DataMember]
      public string Id { get; set; }
  
      [DataMember]
      public string Name { get; set; }
  }
  
  [DataContract]
  public class DeleteCustomer
  {
      [DataMember]
      public string Id { get; set; }
  }
  
  [DataContract]
  public class GetCustomersResponse : IHasResponseStatus
  {
      [DataMember]
      public string Id { get; set; }
  
      [DataMember]
      public string Name { get; set; }
  
      [DataMember]
      public ResponseStatus ResponseStatus { get; set; }
  }
  
  [DataContract]
  public class UpdateCustomerResponse : IHasResponseStatus
  {
      [DataMember]
      public string Id { get; set; }
  
      [DataMember]
      public string Name { get; set; }
  
      [DataMember]
      public ResponseStatus ResponseStatus { get; set; }
  }
  
  [DataContract]
  public class AddCustomerResponse : IHasResponseStatus
  {
      [DataMember]
      public string Id { get; set; }
  
      [DataMember]
      public string Name { get; set; }
  
      [DataMember]
      public ResponseStatus ResponseStatus { get; set; }
  }
  
  [DataContract]
  public class DeleteCustomerResponse : IHasResponseStatus
  {
      [DataMember]
      public string Id { get; set; }
  
      [DataMember]
      public string Name { get; set; }
  
      [DataMember]
      public ResponseStatus ResponseStatus { get; set; }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>I use SoapUi to call the method GetCustomers that throws an error if id equals 0, and i would expect the ResponseStatus  to be set, but it isn't. When calling from SoapUi i get the following error:</p>
  
  <p>
     
        
     
  </p>
  
  <p>I have no clue how to get reponsestatus set proberly, any hints are appreciated.</p>