In my AngularJS (1.5) app I am calling my backend endpoints with the $http service like this:
$http.post('url', _params).then(function (response) {
}).catch(function (error) {
});
Intermittently, my error coming back is null. There is no status or error code or anything like that. What could be the reason for that? I have a perfect Internet connection on the client computer.
Edit: The status code is actually -1. Here is an example of the response:
"data": null,
"status": -1,
"config": {
"method": "POST",
"transformRequest": [
null
],
"transformResponse": [
null
],
"timeout": 8000,
"cache": false,
"url": "https://myurl",
"data": {
"username": "hello"
},
"headers": {
"Accept": "application/json, text/plain, */*",
"Content-Type": "application/json;charset=utf-8"
}
},
"statusText": ""