Skip to content

Commit 407247f

Browse files
martinbigiofacebook-github-bot-3
authored andcommitted
Don't swallow client errors
Reviewed By: @​swarr Differential Revision: D2472285
1 parent d26d470 commit 407247f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packager/react-packager/src/SocketInterface/SocketClient.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ class SocketClient {
2929

3030
this._sock = net.connect(sockPath);
3131
this._ready = new Promise((resolve, reject) => {
32-
this._sock.on('connect', () => resolve(this));
32+
this._sock.on('connect', () => {
33+
this._sock.removeAllListeners('error');
34+
resolve(this);
35+
});
3336
this._sock.on('error', (e) => {
3437
e.message = `Error connecting to server on ${sockPath} ` +
3538
`with error: ${e.message}`;

0 commit comments

Comments
 (0)