Improve error handling in JavaScript promises

This commit is contained in:
Francis Lachapelle committed 2015-06-11 15:49:20 -04:00
1 parent 1a1d51f427
commit 34d7a3bf52
2 files changed
+14 -8

No files matched your search

+4 -1
View File
@@ -76,7 +76,10 @@
params: params
})
.success(deferred.resolve)
.error(deferred.reject);
.error(function(data, status) {
if (status == 404)
return deferred.reject();
});
return deferred.promise;
};