mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-02-05 23:19:37 +00:00
chore: noThrowError
This commit is contained in:
parent
4b617ed77b
commit
b66e51eb7c
@ -63,7 +63,7 @@ export class OB11ActiveWebSocketAdapter implements IOB11NetworkAdapter {
|
||||
|
||||
close() {
|
||||
if (this.isClosed) {
|
||||
throw new Error('Cannot close a closed WebSocket connection');
|
||||
this.logger.logError('Cannot close a closed WebSocket connection');
|
||||
}
|
||||
this.isClosed = true;
|
||||
if (this.connection) {
|
||||
@ -105,7 +105,7 @@ export class OB11ActiveWebSocketAdapter implements IOB11NetworkAdapter {
|
||||
}
|
||||
}
|
||||
WsReply(data: any) {
|
||||
if (this.connection?.readyState === NodeWebSocket.OPEN) {
|
||||
if (this.connection?.readyState === NodeWebSocket.OPEN && !this.isClosed) {
|
||||
this.connection?.send(JSON.stringify(data));
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user