mirror of
https://github.com/zotero/zotero.git
synced 2026-09-29 01:41:24 +00:00
Restore rejection of last feed item when FeedReader terminates
Without this, the "should reject if the provided url is not a valid feed" test fails Follow-up to #5412
This commit is contained in:
parent
c1270e635e
commit
4a5689e9b6
1 changed files with 11 additions and 0 deletions
|
|
@ -221,6 +221,17 @@ Zotero.FeedReader.prototype.terminate = function (status) {
|
|||
|
||||
// Reject feed promise if not resolved yet
|
||||
this._feedProcessed.reject(new Error(status));
|
||||
|
||||
// Reject feed item promise if not resolved yet
|
||||
let lastItem = this._feedItems[this._feedItems.length - 1];
|
||||
// It seemed like a good idea to reject the last item but
|
||||
// it's not really been useful yet, aside from bluebird
|
||||
// throwing errors about unhandled rejections in tests
|
||||
// so we suppress them here. TODO: We should probably
|
||||
// rethink whether this code makes sense and make it better.
|
||||
// FIXME: fx140: We can no longer "handle" the rejection here
|
||||
let er = new Error(status);
|
||||
lastItem.reject(er);
|
||||
};
|
||||
|
||||
Zotero.defineProperty(Zotero.FeedReader.prototype, 'feedProperties', {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue