mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-02-28 18:14:08 +08:00
fix(db): can manually call _handleSetupError with no args
This commit is contained in:
parent
8d88641005
commit
035074d183
2 changed files with 6 additions and 6 deletions
|
@ -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()
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in a new issue