Skip to content

Commit d70451d

Browse files
author
Ilya Radchenko
committed
Remove errors from upgrade commands
1 parent 4b56842 commit d70451d

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

lib/models/upgrade/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,24 +90,24 @@ function isNeeded(version, done) {
9090

9191
function isFreshDb(cb) {
9292
models.User.count(function(err, res) {
93-
if (err) throw err;
93+
if (err) return cb(err);
9494

9595
if (res === 0) {
9696
return cb(null, true);
9797
}
9898

99-
return cb('there are users.', false);
99+
return cb(undefined, false);
100100
});
101101
}
102102

103103
function needConfigObj(cb) {
104104
models.Config.count(function(err, res) {
105-
if (err) throw err;
105+
if (err) return err;
106106

107107
if (res === 0) {
108108
return cb(null, true);
109109
}
110110

111-
return cb('there are ' + res + 'configs.', false);
111+
return cb(undefined, false);
112112
});
113113
}

0 commit comments

Comments
 (0)