umbRequestHelper.resourcePromise is never rejected.
I have the following function:
save: function (dataFeed) {
return umbRequestHelper.resourcePromise($http.post(umbRequestHelper.getApiUrl('dataFeedBaseUrl', 'Save'), dataFeed), 'Failed to save API key');
},
I'm calling it like this:
dataFeedResource.save(vm.dataFeed).then(function () {
//Why is this being called when the API fails?
...
}).catch( function () {
//Why is this not being called when the API fails?
...
});
Even when I return 400 or 500 error from the API, the promise is never rejected, so .catch() is never called. Why is this?
umbRequestHelper.resourcePromise is never rejected.
I have the following function:
I'm calling it like this:
Even when I return 400 or 500 error from the API, the promise is never rejected, so
.catch()
is never called. Why is this?Many thanks
Solved the mystery. Turns out an interceptor was messing with the response from the API.
is working on a reply...