Skip to content
This repository has been archived by the owner on Dec 2, 2020. It is now read-only.

Exit with failure when an error occured while connecting to mongod. #134

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion lib/cube/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,11 @@ module.exports = function(options) {
// Connect to mongodb.
util.log("starting mongodb client");
database.open(options, function (error, db) {
if (error) throw error;
if (error) {
util.log("mongo exception: " + error);
util.log(error.stack);
process.exit(1)
}
server.register(db, endpoints);
meta = require("./event").putter(db);
util.log("starting http server on port " + options["http-port"]);
Expand Down