mirror of
https://github.com/status-im/react-native.git
synced 2025-02-25 23:55:23 +00:00
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…
x
Reference in New Issue
Block a user