Tenho essa chamada ajax:
$.ajax({
method: "GET",
url: "/Shipper/getFullAddress",
data: {
postalCode: value
},
dataType: 'json',
success: function(data) {
$('#AddressStreet').val(data.AddressStreet);
$('#AddressNeighborhood').val(data.AddressNeighborhood);
$('#AddressCity').val(data.AddressCity);
},
error: function(jqXHR, textStatus, errorThrown) {
console.log(jqXHR);
console.log(textStatus);
console.log(errorThrown);
}
})
que chama esse metodo:
[AjaxCall]
public JsonResult getFullAddress(string postalCode) {
try {
var address = getAddressByZipCode(postalCode);
return Json(address, JsonRequestBehavior.AllowGet);
} catch (System.Exception ex) {
return Json(ex.Message);
}
}
Queria mostrar a exception message na minha view, mas a minha chama me retorna isso: