Throw errors instead of strings in FeedReader rejections

This commit is contained in:
Dan Stillman 2016-04-29 23:32:49 -04:00
parent b4a9858f37
commit 750d691712

View file

@ -180,13 +180,13 @@ Zotero.FeedReader.prototype.terminate = function(status) {
// Reject feed promise if not resolved yet
if (this._feedProcessed.promise.isPending()) {
this._feedProcessed.reject(status);
this._feedProcessed.reject(new Error(status));
}
// Reject feed item promise if not resolved yet
let lastItem = this._feedItems[this._feedItems.length - 1];
if (lastItem.promise.isPending()) {
lastItem.reject(status);
lastItem.reject(new Error(status));
}
// Close feed connection