diff --git a/server/src/rooms.ts b/server/src/rooms.ts index 7d4da53..3a6eca5 100644 --- a/server/src/rooms.ts +++ b/server/src/rooms.ts @@ -365,8 +365,13 @@ export class Rooms { setImmediate(() => { // A room forgotten and loaded again drives itself; this one is no longer the table. if (this.rooms.get(room.id) !== room) return; - this.driveBots(room); - this.botsSpeak(room, 'phase'); + try { + this.driveBots(room); + this.botsSpeak(room, 'phase'); + } catch (e) { + // Nothing is waiting on this callback: an error here would take the process down, so it is logged and the table left as it stands. + console.error(`${room.id}: the bots could not move: ${e instanceof Error ? e.stack ?? e.message : String(e)}`); + } }); }