mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-03-26 23:24:06 +08:00
Don't swallow client errors
Reviewed By: @swarr Differential Revision: D2472285
This commit is contained in:
committed by
facebook-github-bot-3
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}`;
|
||||
|
||||
Reference in New Issue
Block a user