fix: db.js mongoose error message

This commit is contained in:
suxiaoxin 2018-01-26 14:37:07 +08:00
parent 3fa8044eb5
commit 8813d67afc

View File

@ -25,7 +25,10 @@ function connect(callback) {
let db = mongoose.connect(`mongodb://${config.db.servername}:${config.db.port}/${config.db.DATABASE}`, options, function(err){
yapi.commons.log(err +'mongodb Authentication failed', 'error');
if(err){
yapi.commons.log(err +', mongodb Authentication failed', 'error');
}
});
db.then(function () {