Skip to content

Commit

Permalink
Merge pull request #1 from zysam/fix#sign_bug
Browse files Browse the repository at this point in the history
fix: db 的连接 err 放错位置。
  • Loading branch information
zysam committed Jan 21, 2016
2 parents 9bea47d + ed642cf commit 32d9b28
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 1 addition & 2 deletions 1.x/sign/src/server/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
}

Expand Down
3 changes: 2 additions & 1 deletion 1.x/sign/src/server/config/db.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 32d9b28

Please sign in to comment.