From: Luigi Pinca Date: Wed, 29 Jul 2015 14:45:00 +0000 (+0200) Subject: throw the error instead of calling `process.exit` X-Git-Url: https://git.saalbach.dev/?a=commitdiff_plain;h=4c87c655a86584849d4704c793fd8cdaac06a4e5;p=binbsis50.git throw the error instead of calling `process.exit` --- 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];