feat(ws): add additional info to wsError debug event (#434)

* feat(ws): better error debug message

* Update src/ws/shard.ts

Co-authored-by: Ayyan <ayyantee@gmail.com>

Co-authored-by: Ayyan <ayyantee@gmail.com>
This commit is contained in:
ITOH
2021-01-23 20:16:04 +01:00
committed by GitHub
parent f70a989a21
commit 26f8321ee9
+5 -2
View File
@@ -67,8 +67,11 @@ export function createShard(
} }
}; };
ws.onerror = ({ timeStamp }) => { ws.onerror = (errorEvent) => {
eventHandlers.debug?.({ type: "wsError", data: { timeStamp } }); eventHandlers.debug?.({
type: "wsError",
data: { shardID: basicShard.id, ...errorEvent },
});
}; };
ws.onmessage = ({ data: message }) => { ws.onmessage = ({ data: message }) => {