When cancelling an http request like this:
$scope.runTest = function() {
if (canceler) canceler.resolve();
canceler = $q.defer();
$http({
method: 'GET',
url: 'http://www.google.com/',
timeout: canceler.promise
})
.success(function(data) {
$scope.result.push({msg: "this won't be displayed on cancel"});
})
.error(function(data) {
$scope.result.push({msg: "this will be displayed on cancel"});
});
};
Is it possible to make the cancelled HTTP request have a specific HTTP code, like 205? It causes http interceptors to be triggered with http status 0, which is also used for timeouts or no network connection. I'd like to be able to differentiate between the two scenarios in the interceptors
Thanks!