I am trying to understand how to get to the reject part of the .then() in angular.
C# Method
public int Foo(){
int foo = 1;
return foo;
}
I have tried throw HttpResponseException
with 404
and 500
, however even that response is caught and handled in the first part of the .then() promise. I just want to understand what sort of error needs to occur for it to go into the latter part.
I have used this as source to throw the response exception
Throw HttpResponseException or return Request.CreateErrorResponse?
Example angular method
foo.then(function(response){
//success do something
}), function(error){
// how to come here?
})
If I haven't explained well please do let me know, I am simply after getting to the reject
part of the function.