]> git.example.dev Git - binbsis50.git/commitdiff
throw the error instead of calling `process.exit`
authorLuigi Pinca <luigipinca@gmail.com>
Wed, 29 Jul 2015 14:45:00 +0000 (16:45 +0200)
committerLuigi Pinca <luigipinca@gmail.com>
Wed, 29 Jul 2015 15:08:32 +0000 (17:08 +0200)
lib/rooms.js

index 5510eae2595b8c241ba1e5c2940866b1804c7784..6e859518425f815bd2f30616609541c0a8caa360 100644 (file)
@@ -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];