diff --git a/1.x/sign/src/server/app.js b/1.x/sign/src/server/app.js index a1981aa..42cdf90 100644 --- a/1.x/sign/src/server/app.js +++ b/1.x/sign/src/server/app.js @@ -19,8 +19,7 @@ if (!module.parent) { console.log('%s is listening port: %d !!!', config.app.name, config.app.port); }) .catch(function(err) { - console.error('connect to %s error', config.mongo.url, err.message); - process.exit(1); + console.error(err); }); } diff --git a/1.x/sign/src/server/config/db.js b/1.x/sign/src/server/config/db.js index 4a4a3b7..167c2bb 100644 --- a/1.x/sign/src/server/config/db.js +++ b/1.x/sign/src/server/config/db.js @@ -7,7 +7,8 @@ module.exports = function() { return new Promise(function(resolve, reject) { mongoose.connect(config.mongo.url, function(err) { if (err) { - return reject(err); + console.error('connect to %s error', config.mongo.url, err.message); + process.exit(1); } console.info(`mongodb connected: ${config.mongo.url} !!!`); return resolve();