[fix] Error handling in socketio
This commit is contained in:
parent
f63a2126b6
commit
2181da8541
1 changed files with 11 additions and 4 deletions
15
socketio.js
15
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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue