From b2b751e0a099fcb030d0ff25f37acf320fbf3b60 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sat, 25 Feb 2017 18:09:15 -0500 Subject: [PATCH] Fix error when DB backup can't be opened --- chrome/content/zotero/xpcom/db.js | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/chrome/content/zotero/xpcom/db.js b/chrome/content/zotero/xpcom/db.js index 8b6956998..22f086cc2 100644 --- a/chrome/content/zotero/xpcom/db.js +++ b/chrome/content/zotero/xpcom/db.js @@ -1057,23 +1057,13 @@ Zotero.DBConnection.prototype.backupDatabase = Zotero.Promise.coroutine(function var connection = storageService.openDatabase(Zotero.File.pathToFile(tmpFile)); } catch (e) { - this._debug("Database file '" + OS.Path.basename(tmpFile) + "' is corrupt -- skipping backup"); + Zotero.logError(e); + this._debug("Database file '" + OS.Path.basename(tmpFile) + "' can't be opened -- skipping backup"); if (yield OS.File.exists(tmpFile)) { yield OS.File.remove(tmpFile); } return false; } - finally { - let resolve; - connection.asyncClose({ - complete: function () { - resolve(); - } - }); - yield new Zotero.Promise(function () { - resolve = arguments[0]; - }); - } // Special backup if (!suffix && numBackups > 1) {