I\'m tearing my hair out over this one, so bear with me (it\'s a long post).
Here is another shot. I'll leave my original attempt incase that solution helps someone else.
To fire the error condidition for the $.ajax call you will need an error code in your response
protected virtual void ApplyHttpResponseSettings(ref Message fault, System.Net.HttpStatusCode statusCode, string statusDescription)
{
var httpResponse = new HttpResponseMessageProperty()
{
//I Think this could be your problem, if this is not an error code
//The error condition will not fire
//StatusCode = statusCode,
//StatusDescription = statusDescription
//Try forcing an error code
StatusCode = System.Net.HttpStatusCode.InternalServerError;
};
httpResponse.Headers[HttpResponseHeader.ContentType] = "application/json";
httpResponse.Headers["jsonerror"] = "true";
fault.Properties.Add(HttpResponseMessageProperty.Name, httpResponse);
}
Heres hoping my second attmpt is more useful to you!