Additional logging for "Item collection not found" error in toJSON()

This commit is contained in:
Dan Stillman 2020-02-16 12:43:21 -05:00
parent a53f363b8d
commit 5c95d4e0ba

View file

@ -4506,7 +4506,7 @@ Zotero.Item.prototype.toJSON = function (options = {}) {
obj.collections = this.getCollections().map(function (id) {
var { libraryID, key } = this.ContainerObjectsClass.getLibraryAndKeyFromID(id);
if (!key) {
throw new Error("Item collection " + id + " not found");
throw new Error("Collection " + id + " not found for item " + this.libraryKey);
}
return key;
}.bind(this));