Skip to content

Commit cc202cd

Browse files
committed
games: Don't log ChatErrors from join attempts
1 parent 0914551 commit cc202cd

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/ps/handlers/joins.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { PSAltCache, PSGames, PSSeenCache } from '@/cache';
22
import { rename } from '@/database/alts';
33
import { seeUser } from '@/database/seens';
44
import { fromHumanTime, toId } from '@/tools';
5+
import { ChatError } from '@/utils/chatError';
56
import { debounce } from '@/utils/debounce';
67

78
import type { Client } from 'ps-client';
@@ -18,7 +19,12 @@ export function joinHandler(this: Client, room: string, user: string, isIntro: b
1819
.filter(game => game.roomid === room);
1920

2021
roomGames.forEach(game => {
21-
if (game.hasPlayerOrSpectator(user)) game.update(toId(user));
22+
if (game.hasPlayerOrSpectator(user))
23+
try {
24+
game.update(toId(user));
25+
} catch (err) {
26+
if (!(err instanceof ChatError)) throw err;
27+
}
2228
});
2329
}
2430

0 commit comments

Comments
 (0)