mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-27 19:25:11 +08:00
Client should throw when server unexpectedly closes the connection
Reviewed By: @natthu Differential Revision: D2425357
This commit is contained in:
committed by
facebook-github-bot-7
parent
3cfac35fd8
commit
9b27116798
@@ -59,7 +59,12 @@ class SocketServer {
|
||||
const bunser = new bser.BunserBuf();
|
||||
sock.on('data', (buf) => bunser.append(buf));
|
||||
bunser.on('value', (m) => this._handleMessage(sock, m));
|
||||
bunser.on('error', (e) => console.error(e));
|
||||
bunser.on('error', (e) => {
|
||||
e.message = 'Unhandled error from the bser buffer. ' +
|
||||
'Either error on encoding or message handling: \n' +
|
||||
e.message;
|
||||
throw e;
|
||||
});
|
||||
}
|
||||
|
||||
_handleMessage(sock, m) {
|
||||
|
||||
Reference in New Issue
Block a user