From 407247fe1e1e212b1235e83f3d78d2666657cc2d Mon Sep 17 00:00:00 2001 From: Martin Bigio Date: Wed, 23 Sep 2015 12:38:55 -0700 Subject: [PATCH] Don't swallow client errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed By: @​swarr Differential Revision: D2472285 --- packager/react-packager/src/SocketInterface/SocketClient.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packager/react-packager/src/SocketInterface/SocketClient.js b/packager/react-packager/src/SocketInterface/SocketClient.js index ca34150e2..0ff974421 100644 --- a/packager/react-packager/src/SocketInterface/SocketClient.js +++ b/packager/react-packager/src/SocketInterface/SocketClient.js @@ -29,7 +29,10 @@ class SocketClient { this._sock = net.connect(sockPath); this._ready = new Promise((resolve, reject) => { - this._sock.on('connect', () => resolve(this)); + this._sock.on('connect', () => { + this._sock.removeAllListeners('error'); + resolve(this); + }); this._sock.on('error', (e) => { e.message = `Error connecting to server on ${sockPath} ` + `with error: ${e.message}`;