You could parse the responseText
string and then use the Message
property:
.fail(function (jqXhr, textStatus, errorThrown) {
if (jqXhr.getResponseHeader('Content-Type').indexOf('application/json') > -1) {
// only parse the response if you know it is JSON
var error = $.parseJSON(jqXhr.responseText);
alert(error.Message);
} else {
alert('Fatal error');
}
});