mirror of
https://github.com/danbulant/discord.js
synced 2026-06-09 01:31:29 +00:00
fix(WebSocketConnection): stringify data when no websocket is available
[object Object] is not really descriptive
This commit is contained in:
parent
12e041bc2b
commit
60013b7a10
1 changed files with 2 additions and 2 deletions
|
|
@ -212,7 +212,7 @@ class WebSocketConnection extends EventEmitter {
|
||||||
*/
|
*/
|
||||||
_send(data) {
|
_send(data) {
|
||||||
if (!this.ws || this.ws.readyState !== WebSocket.OPEN) {
|
if (!this.ws || this.ws.readyState !== WebSocket.OPEN) {
|
||||||
this.debug(`Tried to send packet ${data} but no WebSocket is available!`);
|
this.debug(`Tried to send packet ${JSON.stringify(data)} but no WebSocket is available!`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.ws.send(this.pack(data));
|
this.ws.send(this.pack(data));
|
||||||
|
|
@ -225,7 +225,7 @@ class WebSocketConnection extends EventEmitter {
|
||||||
*/
|
*/
|
||||||
send(data) {
|
send(data) {
|
||||||
if (!this.ws || this.ws.readyState !== WebSocket.OPEN) {
|
if (!this.ws || this.ws.readyState !== WebSocket.OPEN) {
|
||||||
this.debug(`Tried to send packet ${data} but no WebSocket is available!`);
|
this.debug(`Tried to send packet ${JSON.stringify(data)} but no WebSocket is available!`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.ratelimit.queue.push(data);
|
this.ratelimit.queue.push(data);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue