diff --git a/chrome/content/zotero/xpcom/error.js b/chrome/content/zotero/xpcom/error.js index 51af0eadbf..00972e2821 100644 --- a/chrome/content/zotero/xpcom/error.js +++ b/chrome/content/zotero/xpcom/error.js @@ -25,7 +25,7 @@ Zotero.Error = function (message, error, data) { - this.name = "ZOTERO_ERROR"; + this.name = "Zotero Error"; this.message = message; this.data = data; if (parseInt(error) == error) { @@ -35,6 +35,8 @@ Zotero.Error = function (message, error, data) { this.error = Zotero.Error["ERROR_" + error] ? Zotero.Error["ERROR_" + error] : 0; } } +Zotero.Error.prototype = new Error; + Zotero.Error.ERROR_UNKNOWN = 0; Zotero.Error.ERROR_MISSING_OBJECT = 1; diff --git a/chrome/content/zotero/xpcom/sync.js b/chrome/content/zotero/xpcom/sync.js index 9ed9e9fca9..616d3b3737 100644 --- a/chrome/content/zotero/xpcom/sync.js +++ b/chrome/content/zotero/xpcom/sync.js @@ -2416,7 +2416,7 @@ Zotero.Sync.Server = new function () { function _error(e, extraInfo, skipReload) { - if (e.name && e.name == 'ZOTERO_ERROR') { + if (e instanceof Zotero.Error) { switch (e.error) { case Zotero.Error.ERROR_MISSING_OBJECT: case Zotero.Error.ERROR_FULL_SYNC_REQUIRED: