Reputation: 2706
This is jquery function:
$.get("/url", function(){
//success
}).fail(function(){
//fail <---- how to make code go in there.
});
Problem is how to let program goes into .fail block, I use .Net MVC, However, set break point in Controller doesn't trigger a timeout exception then leads to fail callback.
Don't know how people test this.
Should I start looking at some tools ?
Upvotes: 8
Views: 349
Reputation: 263
Use an invalid endpoint URL. You should get 404 - not found http status code error.
Upvotes: 0
Reputation: 30247
Put this in your Controller method:
return new HttpStatusCodeResult(HttpStatusCode.NotFound);
Upvotes: 1