Additional debugging for file sync error

"attachmentSyncedModificationTime must be a number"
This commit is contained in:
Dan Stillman 2019-09-11 00:13:23 -04:00
parent 0bd04877bf
commit 3666da5b22

View file

@ -2995,7 +2995,7 @@ Zotero.defineProperty(Zotero.Item.prototype, 'attachmentSyncedModificationTime',
},
set: function (val) {
if (!this.isAttachment()) {
throw ("attachmentSyncedModificationTime can only be set for attachment items");
throw new Error("attachmentSyncedModificationTime can only be set for attachment items");
}
switch (this.attachmentLinkMode) {
@ -3008,9 +3008,11 @@ Zotero.defineProperty(Zotero.Item.prototype, 'attachmentSyncedModificationTime',
}
if (typeof val != 'number') {
Zotero.debug(val, 2);
throw new Error("attachmentSyncedModificationTime must be a number");
}
if (parseInt(val) != val || val < 0) {
Zotero.debug(val, 2);
throw new Error("attachmentSyncedModificationTime must be a timestamp in milliseconds");
}
if (val < 10000000000) {