This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Description
Using Angularjs version 1.0.8 and 1.0.7
I have this function and at server side I just added an unchecked exception to see if my AngularJS code handles server side errors when performing Ajax request using the $http service:
this.save = function(formData, successCallback, baseRelativeUrl) {
$http.post(baseRelativeUrl + '/save', formData)
.success(function (data, status, headers, config) {
successCallback(data);
})
.error (function (data, status, headers, config) {
$rootScope.$emit('displayAlerts', [{type: 'error', msg: 'There was a server side error'}]);
});
};
Despite the response status code being 500, the success function is being executed and the error function ignored.
Thank in advance for your help!