Throwing ArgumentException returning status 200 with plain text message

I’m throwing an ArgumentException in a service, but it comes back to the browser with HTTP status 200, I was expecting 400 (described here)

HTTP/1.1 200 OK
Cache-Control: private
Content-Type: application/json; charset=utf-8
Vary: Accept
Server: Microsoft-IIS/8.5
X-Powered-By: ServiceStack/4.042 Win32NT/.NET
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Thu, 06 Aug 2015 18:12:33 GMT
Content-Length: 64

I have MapExceptionToStatusCode set up for other exceptions, but even if I add ArgumentException => 400, it still comes back as 200.

Has this behaviour changed, or could it be remapped elsewhere?

Never mind. My fault. I was returning it instead of throwing it!! Copy/pasta error.

I’ll leave post here in case anyone else does same silly thing.

Hi Colin,

Thanks for the update, but please also include the actual source code being used in future, as it saves a lot of time in being able to identify the issue and is needed in order to be able to reproduce the error.