From b0420e347a32eb09fd93ef405514ad9c4117d0b4 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Fri, 12 Feb 2010 09:34:37 +0000 Subject: [PATCH] Make errors updating translators and styles on upgrade non-fatal --- chrome/content/zotero/xpcom/schema.js | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/chrome/content/zotero/xpcom/schema.js b/chrome/content/zotero/xpcom/schema.js index 33657a6b4..0f0029d6e 100644 --- a/chrome/content/zotero/xpcom/schema.js +++ b/chrome/content/zotero/xpcom/schema.js @@ -194,7 +194,13 @@ Zotero.Schema = new function(){ } } - var up4 = this.updateBundledFiles(); + try { + var up4 = this.updateBundledFiles(); + } + catch (e) { + Zotero.debug(e); + Components.utils.reportError(e); + } if (up2 || up3 || up4) { // Run a manual scraper update if upgraded and pref set @@ -1078,8 +1084,6 @@ Zotero.Schema = new function(){ Zotero.DB.commitTransaction(); self.dbInitialized = true; - - Zotero.Schema.updateBundledFiles(); } catch(e){ Zotero.debug(e, 1); @@ -1088,6 +1092,15 @@ Zotero.Schema = new function(){ alert('Error initializing Zotero database'); throw(e); } + + try { + Zotero.Schema.updateBundledFiles(); + } + catch (e) { + Zotero.debug(e); + Components.utils.reportError(e); + alert('Error updating Zotero translators and styles'); + } }