Skip to content
Permalink
Browse files

emit error rather than throw since client is an event emitter

  • Loading branch information...
jcrugzz committed Mar 24, 2013
1 parent 870439d commit 1d788e71f047ee9e5ebafc6a643ac07a8f61c3b4
Showing with 3 additions and 5 deletions.
  1. +3 −5 lib/godot/net/client.js
@@ -166,11 +166,9 @@ Client.prototype.connect = function (port, host, callback) {

function error (arg) {
var err = new Error(arg + ' required to connect');
if (callback) {
return callback(err);
}

throw err;
return callback
? callback(err)
: self.emit('error', err) ;
}

function onError(err) {

0 comments on commit 1d788e7

Please sign in to comment.
You can’t perform that action at this time.