I'm not able to catch the http error in the error function call back when posting an http request.
Here is the client side:
$http.post('/updateBuildings',
$.param(
{'element_id': element_id}
)).success(function(data) {
tmp.GetBuildings(data.new_building_id);
}).error(function(data) {
console.log('response: ',data);
});
};
The server side is returning an http error deliberately : status code: 401, msg: "Sorry, access denied."
The browser (google chrome) writes to the log by itself (see attachment) but I'm not able to catch the error in angular and present an alert for the user for example.
Any ideas?
Thanks