call back with errors instead of throwing within the Storage module

This commit is contained in:
ansuz
2020-03-24 13:31:03 -04:00
parent 1240f4a2a5
commit e128683ffb
7 changed files with 30 additions and 12 deletions

View File

@@ -215,12 +215,14 @@ module.exports.create = function (config, cb) {
// create a pin store
Store.create({
filePath: pinPath,
}, w(function (s) {
}, w(function (err, s) {
if (err) { throw err; }
Env.pinStore = s;
}));
// create a channel store
Store.create(config, w(function (_store) {
Store.create(config, w(function (err, _store) {
if (err) { throw err; }
config.store = _store;
Env.msgStore = _store; // API used by rpc
Env.store = _store; // API used by historyKeeper