I am working in Angular and I need to signify an error to a promise further down the chain when the result is being resolved in .success().
I call a function in my service from my controller like
myService.myFunction().then(
function(results){
// do success stuff
},
function(err){
// do failure stuff
});
myFunction is something like
myFunction(){
return $http.get('url')
.success(function(results){})
.error(function(err){})
}
Based on certain conditions, I need to have .then() execute the errorCallback even though $http.get().success() was triggered. How can I make it look like $http received an error?