2
2
mirror of https://git.coolaj86.com/coolaj86/telebit.js.git synced 2025-03-14 12:10:37 +00:00

suppressing log when trying to send on closing websocket

This commit is contained in:
tigerbot 2017-04-26 17:37:52 -06:00
parent 7a9d06e67b
commit 5a3fe4468a

View File

@ -239,7 +239,11 @@ function run(copts) {
try {
wstunneler.send(msg, {binary: true});
} catch (err) {
console.warn('[sendMessage] error sending websocket message', err);
// There is a chance that this occurred after the websocket was told to close
// and before it finished, in which case we don't need to log the error.
if (wstunneler.readyState !== wstunneler.CLOSING) {
console.warn('[sendMessage] error sending websocket message', err);
}
}
}
}