mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-17 20:13:30 +01:00
fix(WebSocketConnection): stringify data when no websocket is available
[object Object] is not really descriptive
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user