Add logging information when client's socket gets closed unexpetedly

Reviewed By: @amasad

Differential Revision: D2468293
This commit is contained in:
Martín Bigio 2015-09-22 15:18:34 -07:00 committed by facebook-github-bot-0
parent 06b6ef4d84
commit a2b8762e4d
1 changed files with 7 additions and 1 deletions

View File

@ -46,7 +46,13 @@ class SocketClient {
this._sock.on('close', () => { this._sock.on('close', () => {
if (!this._closing) { if (!this._closing) {
throw new Error('Server closed unexpectedly' + getServerLogs()); const sockPathExists = fs.existsSync(sockPath);
throw new Error(
'Server closed unexpectedly.\n' +
'Socket path: `' + sockPath + '` ' +
(sockPathExists ? ' exists.' : 'doesn\'t exist') + '\n' +
getServerLogs()
);
} }
}); });
} }