Skip to content

Commit 7f09ed5

Browse files
committed
4003 on room full
1 parent 1f3d30c commit 7f09ed5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Room.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
* @typedef {import('./Client')} Client
33
*/
44

5+
const ConnectionError = require('./ConnectionError');
6+
57
/**
68
* @typedef {string} RoomID A unique ID for a Room.
79
*/
@@ -58,7 +60,7 @@ class Room {
5860
throw new Error(`Client is already added to room ${this.id}`);
5961
}
6062
if (this.clients.length >= this.maxClients) {
61-
throw new Error(`Too many clients are connected to room ${this.id}`);
63+
throw new ConnectionError(ConnectionError.Overloaded, `Too many clients are connected to room ${this.id}`);
6264
}
6365
this.clients.push(client);
6466
}

0 commit comments

Comments
 (0)