Skip to content

Commit

Permalink
changes to client and server
Browse files Browse the repository at this point in the history
  • Loading branch information
pocesar committed Apr 9, 2014
1 parent acd85b3 commit 42178e9
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions lib/client.js
Expand Up @@ -292,13 +292,17 @@ module.exports = function (classes){

var d = q.defer(), self = this;

self.socket.write(data, function clientSocketWrite(err){
if (err) {
d.reject(err);
} else {
d.resolve(self);
}
});
try {
self.socket.write(data, function clientSocketWrite(err){
if (err) {
d.reject(err);
} else {
d.resolve(self);
}
});
} catch (err) {
d.reject(err);
}

return d.promise;
}
Expand Down

0 comments on commit 42178e9

Please sign in to comment.