I have a asp.net MVC 2 web application in all Middle Tier Controller Actions I catch all exceptions, Log, and then rethrows the Exception. This rethrow is picked up by the JQuery Ajax error handler
throw new Exception(e.Message);
I am making an ajax call via JQuery like this
jQuery.ajax({ url: '/controller/action',
success: function(data) { },
error: function(jqXHR, textStatus, errorThrown) {
var error_json = JSON.parse(jqXHR.responseText); // this is returning error
var html_error = error_json["Message"];
}
});
And for some reason jqXHR.responseText is not returning anything anymore and I am getting an error when parsing the responseText. I think it may be a IIS setting since we recently switched to a new webserver. ** Looking into Firebug there is no more JSON response as normal. I just see the server response as a 500 Exception **
Looks like it was an IIS 7 setting. In Error Pages --> Edit Feature Settings --> Select Detailed Errors. –