Add logging information when client's socket gets closed unexpetedly
Reviewed By: @amasad Differential Revision: D2468293
This commit is contained in:
parent
9486642322
commit
c4cb95f2d7
|
@ -46,7 +46,13 @@ class SocketClient {
|
|||
|
||||
this._sock.on('close', () => {
|
||||
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()
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue