From c8b5609f1f3e23bc8d1699e3ee70ff7b5579ea92 Mon Sep 17 00:00:00 2001 From: lukasIO Date: Mon, 18 Nov 2024 15:34:04 +0100 Subject: [PATCH] Add ConnectionErrorReason when cancelling ongoing connection attempt --- src/room/Room.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/room/Room.ts b/src/room/Room.ts index 8a0bd97619..922f79b757 100644 --- a/src/room/Room.ts +++ b/src/room/Room.ts @@ -783,7 +783,9 @@ class Room extends (EventEmitter as new () => TypedEmitter) this.log.warn('abort connection attempt', this.logContext); this.abortController?.abort(); // in case the abort controller didn't manage to cancel the connection attempt, reject the connect promise explicitly - this.connectFuture?.reject?.(new ConnectionError('Client initiated disconnect')); + this.connectFuture?.reject?.( + new ConnectionError('Client initiated disconnect', ConnectionErrorReason.Cancelled), + ); this.connectFuture = undefined; } // send leave