mardi 27 janvier 2015

UI-router $stateChangeError fires on HTTP error? Can I handle the error myself?

I have a resolve function that makes an HTTP call that returns a failed status (409). I want to handle the error myself, but it seems like something is broadcasting the error to $stateChangeError even though I haven't returned anything from my resolve function yet.


How can I allow HTTP errors to occur in resolve? Why doesn't it just use the return value to detect the failure?



resolve:
{
thing: function()
{
return Bluebird.settle( someRequests )
.then( function () { .... } );
}
}


I expected it to reach the then part, but I get a $stateChangeError during the failed request.


Thanks


Aucun commentaire:

Enregistrer un commentaire