In my application, I implemented a "loading screen" feature inspired by this post: 'Click'
However, I am facing an issue where all $http requests are triggering the "success" callback, even for URLs that do not exist.
$http.post("this doesnt even exist", { })
.success(function (data, status, headers, config) {
alert("success"); //even called for non-existing URL
})
.error(function (data, status, headers, config) {
alert("error"); //never triggered
});
Disabling the 'responseInterceptor' resolves the issue. Everything works as expected, with errors being handled correctly (e.g., exceptions, not found URLs, incorrect parameters).
I am fetching data from a .NET Webservice.
The values of parameters in success callback:
data: ''
status: 0
headers: 'function(name) { ... }'
config: JSON.stringify(config) '{"method":"POST","url":"this doesnt even exist","data":{}}'