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

@@ -15,7 +15,8 @@ const init = function (config, cb) {
return void cb('E_INVALID_CONFIG');
}
Store.create(config, function (_store) {
Store.create(config, function (err, _store) {
if (err) { return void cb(err); }
store = _store;
cb();
});