From 2181da854117c577f3968927a7d77b4aa8c01ac3 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 10 Nov 2015 13:53:23 +0530 Subject: [PATCH] [fix] Error handling in socketio --- socketio.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/socketio.js b/socketio.js index 68acd876ab..a92e080269 100644 --- a/socketio.js +++ b/socketio.js @@ -199,13 +199,20 @@ function can_subscribe_doc(args) { docname: args.docname }) .end(function(err, res) { - if(err) console.log(err); - if(!res) { + if (!res) { console.log("No response for doc_subscribe"); + + } else if (res.status == 403) { return; - } - if(res.status == 200) { + + } else if (err) { + console.log(err); + + } else if (res.status == 200) { args.callback(err, res); + + } else { + console.log("Something went wrong", err, res); } }); }