You could set the status code to 500 inside the custom error handler you have seen here
:
filterContext.RequestContext.HttpContext.Response.StatusCode = 500;
and on the client:
$.ajax({
url: '/home/foo',
success: function (result) {
alert('success');
},
error: function (jqXHR, textStatus, errorThrown) {
var json = $.parseJSON(jqXHR.responseText);
// TODO: do something with the json that was returned from the server
}
});