diff --git a/chrome/content/zotero/xpcom/schema.js b/chrome/content/zotero/xpcom/schema.js index 8376e733d..1ea3154b3 100644 --- a/chrome/content/zotero/xpcom/schema.js +++ b/chrome/content/zotero/xpcom/schema.js @@ -1899,7 +1899,8 @@ Zotero.Schema = new function(){ return false; } else if (fromVersion > toVersion) { - throw("Zotero user data DB version is newer than SQL file"); + throw new Error("Zotero user data DB version is newer than SQL file " + + "(" + toVersion + " < " + fromVersion + ")"); } Zotero.debug('Updating user data tables from version ' + fromVersion + ' to ' + toVersion); diff --git a/chrome/content/zotero/xpcom/zotero.js b/chrome/content/zotero/xpcom/zotero.js index f352a0af4..799156335 100644 --- a/chrome/content/zotero/xpcom/zotero.js +++ b/chrome/content/zotero/xpcom/zotero.js @@ -608,13 +608,13 @@ Components.utils.import("resource://gre/modules/Services.jsm"); var updated = Zotero.Schema.updateSchema(); } catch (e) { - if (typeof e == 'string' && e.match('newer than SQL file')) { - var kbURL = "http://zotero.org/support/kb/newer_db_version"; - var msg = Zotero.localeJoin([ - Zotero.getString('startupError.zoteroVersionIsOlder'), - Zotero.getString('startupError.zoteroVersionIsOlder.upgrade') - ]) + "\n\n" - + Zotero.getString('startupError.zoteroVersionIsOlder.current', Zotero.version) + "\n\n" + if (e.toString().match('newer than SQL file')) { + let versions = e.toString().match(/\((\d+) < \d+\)/); + let kbURL = "https://www.zotero.org/support/kb/newer_db_version"; + let msg = Zotero.getString('startupError.zoteroVersionIsOlder') + " " + + Zotero.getString('startupError.zoteroVersionIsOlder.upgrade') + "\n\n" + + Zotero.getString('startupError.zoteroVersionIsOlder.current', Zotero.version) + "\n" + + (versions ? "DB: " + versions[1] + "\n\n" : "\n") + Zotero.getString('general.seeForMoreInformation', kbURL); Zotero.startupError = msg; _startupErrorHandler = function() {