From f9ab60ce2582c0855c9507620484d973a4f8f53a Mon Sep 17 00:00:00 2001 From: Madeline <46743919+MaddyUnderStars@users.noreply.github.com> Date: Tue, 10 Jan 2023 12:54:03 +1100 Subject: Add error handler for individual gateway sockets --- src/gateway/events/Connection.ts | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/gateway/events/Connection.ts b/src/gateway/events/Connection.ts index f3694c51..41b2ff3d 100644 --- a/src/gateway/events/Connection.ts +++ b/src/gateway/events/Connection.ts @@ -35,6 +35,9 @@ export async function Connection( socket.on("close", Close); // @ts-ignore socket.on("message", Message); + + socket.on("error", (err) => console.error("[Gateway]", err)); + // console.log( // `[Gateway] New connection from ${socket.ipAddress}, total ${this.clients.size}`, // ); -- cgit 1.4.1