Browse Source

fix error handling

Yuki Takei 8 years ago
parent
commit
b2296f2b04
2 changed files with 2 additions and 7 deletions
  1. 1 0
      app.js
  2. 1 7
      lib/crowi/index.js

+ 1 - 0
app.js

@@ -35,4 +35,5 @@ growi.start()
   .catch(err => {
   .catch(err => {
     logger.error('An error occurred, unable to start the server');
     logger.error('An error occurred, unable to start the server');
     logger.error(err);
     logger.error(err);
+    process.exit(1);
   });
   });

+ 1 - 7
lib/crowi/index.js

@@ -139,13 +139,7 @@ Crowi.prototype.setupDatabase = function() {
 
 
   const mongoUri = getMongoUrl(this.env);
   const mongoUri = getMongoUrl(this.env);
 
 
-  return mongoose.connect(mongoUri).then(
-    () => {},
-    err => {
-      logger.error('DB Connect Error: ', err);
-      logger.error('DB Connect Error: ', mongoUri);
-    }
-  );
+  return mongoose.connect(mongoUri);
 };
 };
 
 
 Crowi.prototype.setupSessionConfig = function() {
 Crowi.prototype.setupSessionConfig = function() {