Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

emit error rather than throw since client is an event emitter

  • Loading branch information...
commit 1d788e71f047ee9e5ebafc6a643ac07a8f61c3b4 1 parent 870439d
@jcrugzz jcrugzz authored
Showing with 3 additions and 5 deletions.
  1. +3 −5 lib/godot/net/client.js
View
8 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) {
Please sign in to comment.
Something went wrong with that request. Please try again.