commit b2b751e0a099fcb030d0ff25f37acf320fbf3b60 parent cb5e1fa431378e88fa2d0e136c46191af6288bc0 Author: Dan Stillman <dstillman@zotero.org> Date: Sat, 25 Feb 2017 18:09:15 -0500 Fix error when DB backup can't be opened Diffstat:
| M | 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 @@ -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) {