|
|
@ -28,8 +28,12 @@ module.exports = function createClientStore(options = {}) {
|
|
|
|
let data = JSON.stringify(message);
|
|
|
|
let data = JSON.stringify(message);
|
|
|
|
this.socket.send(data, (error) => {
|
|
|
|
this.socket.send(data, (error) => {
|
|
|
|
if (error != null) {
|
|
|
|
if (error != null) {
|
|
|
|
|
|
|
|
if (error.message === "not opened") {
|
|
|
|
|
|
|
|
/* The socket has disappeared. We can safely ignore this. Is there a more reliable way to detect this error than by its message, though? */
|
|
|
|
|
|
|
|
} else {
|
|
|
|
store.emit("error", error);
|
|
|
|
store.emit("error", error);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|