mirror of https://github.com/status-im/metro.git
Add logging information when client's socket gets closed unexpetedly
Reviewed By: @amasad Differential Revision: D2468293
This commit is contained in:
parent
06b6ef4d84
commit
a2b8762e4d
|
@ -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()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue