Don't swallow client errors
Reviewed By: @swarr Differential Revision: D2472285
This commit is contained in:
parent
d26d4708b0
commit
407247fe1e
|
@ -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}`;
|
||||
|
|
Loading…
Reference in New Issue