diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-02-07 12:01:40 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-02-07 12:01:40 +0100 |
commit | ac2f99eb75ea0295dc08e47b91f4b4d54829d004 (patch) | |
tree | 9f0d6d70be66545df336f75be5f1bdefa62c70ca /initializers/database.js | |
parent | a030a9b234d315c180f40d8abd177637c1a91f6a (diff) | |
download | PeerTube-ac2f99eb75ea0295dc08e47b91f4b4d54829d004.tar.gz PeerTube-ac2f99eb75ea0295dc08e47b91f4b4d54829d004.tar.zst PeerTube-ac2f99eb75ea0295dc08e47b91f4b4d54829d004.zip |
Don't use process.exit, throw an error instead
Diffstat (limited to 'initializers/database.js')
-rw-r--r-- | initializers/database.js | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/initializers/database.js b/initializers/database.js index 6e3f11df3..a917442ec 100644 --- a/initializers/database.js +++ b/initializers/database.js | |||
@@ -16,8 +16,7 @@ var database = { | |||
16 | function connect () { | 16 | function connect () { |
17 | mongoose.connect('mongodb://' + host + ':' + port + '/' + dbname) | 17 | mongoose.connect('mongodb://' + host + ':' + port + '/' + dbname) |
18 | mongoose.connection.on('error', function () { | 18 | mongoose.connection.on('error', function () { |
19 | logger.error('Mongodb connection error.') | 19 | throw new Error('Mongodb connection error.') |
20 | process.exit(0) | ||
21 | }) | 20 | }) |
22 | 21 | ||
23 | mongoose.connection.on('open', function () { | 22 | mongoose.connection.on('open', function () { |