We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1f3d30c commit 7f09ed5Copy full SHA for 7f09ed5
src/Room.js
@@ -2,6 +2,8 @@
2
* @typedef {import('./Client')} Client
3
*/
4
5
+const ConnectionError = require('./ConnectionError');
6
+
7
/**
8
* @typedef {string} RoomID A unique ID for a Room.
9
@@ -58,7 +60,7 @@ class Room {
58
60
throw new Error(`Client is already added to room ${this.id}`);
59
61
}
62
if (this.clients.length >= this.maxClients) {
- 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}`);
64
65
this.clients.push(client);
66
0 commit comments