Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

emit error rather than throw since client is an event emitter

  • Loading branch information...
commit 1d788e71f047ee9e5ebafc6a643ac07a8f61c3b4 1 parent 870439d
Jarrett Cruger jcrugzz authored

Showing 1 changed file with 3 additions and 5 deletions. Show diff stats Hide diff stats

  1. +3 5 lib/godot/net/client.js
8 lib/godot/net/client.js
@@ -166,11 +166,9 @@ Client.prototype.connect = function (port, host, callback) {
166 166
167 167 function error (arg) {
168 168 var err = new Error(arg + ' required to connect');
169   - if (callback) {
170   - return callback(err);
171   - }
172   -
173   - throw err;
  169 + return callback
  170 + ? callback(err)
  171 + : self.emit('error', err) ;
174 172 }
175 173
176 174 function onError(err) {

0 comments on commit 1d788e7

Please sign in to comment.
Something went wrong with that request. Please try again.