Skip to content

Commit

Permalink
Add ConnectionErrorReason when cancelling ongoing connection attempt
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasIO committed Nov 18, 2024
1 parent 4dbab2c commit c8b5609
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/room/Room.ts
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,9 @@ class Room extends (EventEmitter as new () => TypedEmitter<RoomEventCallbacks>)
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
Expand Down

0 comments on commit c8b5609

Please sign in to comment.