From cfeaad0662242d5e25594e83b04dd43296a0d233 Mon Sep 17 00:00:00 2001 From: Jordan Pawlett Date: Sat, 9 May 2020 19:26:10 +0100 Subject: [PATCH] Change nomenclature of error message room -> game --- services/rooms-service/src/rooms-service.ts | 2 +- services/websocket-gateway-service/src/DefaultNamespace.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/services/rooms-service/src/rooms-service.ts b/services/rooms-service/src/rooms-service.ts index 5dba1d6e..aa107a39 100644 --- a/services/rooms-service/src/rooms-service.ts +++ b/services/rooms-service/src/rooms-service.ts @@ -314,7 +314,7 @@ export default class RoomsService extends Service { return Promise.resolve(room); } else { // user must be in another room. - throw forbidden('You are already in a room.'); + throw forbidden('You are already in a game.'); } } diff --git a/services/websocket-gateway-service/src/DefaultNamespace.ts b/services/websocket-gateway-service/src/DefaultNamespace.ts index e3c4708c..83d959ba 100644 --- a/services/websocket-gateway-service/src/DefaultNamespace.ts +++ b/services/websocket-gateway-service/src/DefaultNamespace.ts @@ -34,7 +34,8 @@ export default class DefaultNamespace extends BaseNamespace { if (user.socket === client.id && user.disconnectedAt && afterTimeoutTime - user.disconnectedAt > (timeout - 5000)) { this.broker.emit('websocket-gateway.client.disconnected', { _id }); } - }); + }) + .catch(() => this.broker.emit('websocket-gateway.client.disconnected', { _id })); }, timeout); }) // If error, client must have logged out.