diff --git a/src/flux/stores/database-store.coffee b/src/flux/stores/database-store.coffee index 0577711fc..afad449fb 100644 --- a/src/flux/stores/database-store.coffee +++ b/src/flux/stores/database-store.coffee @@ -213,18 +213,18 @@ class DatabaseStore extends NylasStore , (err) => console.log("Completed ANALYZE of database") - _handleSetupError: (err) => + _handleSetupError: (err = (new Error("Manually called _handleSetupError"))) => NylasEnv.reportError(err, {}, noWindows: true) # Temporary: export mail rules. They're the only bit of data in the cache # we can't rebuild. Should be moved to cloud metadata store soon. - @_db.all "SELECT * FROM JSONBlob WHERE id = 'MailRules-V2' LIMIT 1", [], (err, results = []) => - if not err and results.length is 1 + @_db.all "SELECT * FROM JSONBlob WHERE id = 'MailRules-V2' LIMIT 1", [], (mailsRulesErr, results = []) => + if not mailsRulesErr and results.length is 1 exportPath = path.join(NylasEnv.getConfigDirPath(), 'mail-rules-export.json') try fs.writeFileSync(exportPath, results[0]['data']) - catch err - console.log("Could not write mail rules to file: #{err}") + catch writeErr + console.log("Could not write mail rules to file: #{writeErr}") app = require('electron').remote.getGlobal('application') app.rebuildDatabase() diff --git a/src/package-manager.coffee b/src/package-manager.coffee index adf0d6170..ba934eda3 100644 --- a/src/package-manager.coffee +++ b/src/package-manager.coffee @@ -327,7 +327,7 @@ class PackageManager packages installPackageFromPath: (packageSourceDir, callback) -> - jsonPath = path.join(packageSourceDir, 'package.json'); + jsonPath = path.join(packageSourceDir, 'package.json') if not fs.existsSync(jsonPath) return callback(new Error("The folder you selected doesn't look like a valid N1 plugin. All N1 plugins must have a package.json file in the top level of the folder. Check the contents of #{packageSourceDir} and try again."), null)