mirror of
https://codeberg.org/emersion/gamja
synced 2025-03-15 00:47:46 +01:00
lib/client: throw error in send if disconnected
This commit is contained in:
parent
8a5fa4d5c2
commit
3536331f94
@ -341,6 +341,9 @@ export default class Client extends EventTarget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
send(msg) {
|
send(msg) {
|
||||||
|
if (!this.ws) {
|
||||||
|
throw new Error("Failed to send IRC message " + msg.command + ": socket is closed");
|
||||||
|
}
|
||||||
this.ws.send(irc.formatMessage(msg));
|
this.ws.send(irc.formatMessage(msg));
|
||||||
console.log("Sent:", msg);
|
console.log("Sent:", msg);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user