Improve error handling in JavaScript promises

This commit is contained in:
Francis Lachapelle committed 2015-01-08 16:11:07 -05:00
1 parent a702ddeddd
commit 297aec838c
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;
};