From 4c87c655a86584849d4704c793fd8cdaac06a4e5 Mon Sep 17 00:00:00 2001 From: Luigi Pinca Date: Wed, 29 Jul 2015 16:45:00 +0200 Subject: [PATCH] throw the error instead of calling `process.exit` --- lib/rooms.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/rooms.js b/lib/rooms.js index 5510eae..6e85951 100644 --- a/lib/rooms.js +++ b/lib/rooms.js @@ -220,8 +220,7 @@ Room.prototype.initialize = function() { songsdb.zcard([this.roomname], function(err, card) { if (err) { - console.error(err.message); - process.exit(1); + throw err; } room.trackscount = card; @@ -507,8 +506,7 @@ Room.prototype.sendLoadTrack = function() { songsdb.zrange([this.roomname, index, index], function(err, res) { if (err) { - console.error(err.message); - process.exit(1); + throw err; } var id = res[0]; @@ -528,8 +526,7 @@ Room.prototype.sendLoadTrack = function() { , 'trackViewUrl' ], function(err, replies) { if (err) { - console.error(err.message); - process.exit(1); + throw err; } room.artistName = replies[0]; -- 2.54.0