A couple better error messages
This commit is contained in:
parent
72c927c840
commit
1855b5e1f9
|
@ -1227,6 +1227,10 @@ Zotero.DataObject.prototype.toResponseJSON = Zotero.Promise.coroutine(function*
|
|||
|
||||
|
||||
Zotero.DataObject.prototype._preToJSON = function (options) {
|
||||
if (!this._id) {
|
||||
throw new Error(`${this._ObjectType} must be saved before running toJSON()`);
|
||||
}
|
||||
|
||||
var env = { options };
|
||||
env.mode = options.mode || 'new';
|
||||
if (env.mode == 'patch') {
|
||||
|
|
|
@ -4000,7 +4000,7 @@ Zotero.Item.prototype.loadItemData = Zotero.Promise.coroutine(function* (reload)
|
|||
Zotero.debug("Loading item data for item " + this.libraryKey);
|
||||
|
||||
if (!this.id) {
|
||||
throw ('ItemID not set for object before attempting to load data');
|
||||
throw new Error('ItemID not set for object before attempting to load data');
|
||||
}
|
||||
|
||||
if (!this.isNote()) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user