@@ -137,11 +137,11 @@ export default class LocalParticipant extends Participant {
137137
138138 private encryptionType : Encryption_Type = Encryption_Type . NONE ;
139139
140- private reconnectFuture ?: Future < void > ;
140+ private reconnectFuture ?: Future < void , Error > ;
141141
142- private signalConnectedFuture ?: Future < void > ;
142+ private signalConnectedFuture ?: Future < void , Error > ;
143143
144- private activeAgentFuture ?: Future < RemoteParticipant > ;
144+ private activeAgentFuture ?: Future < RemoteParticipant , Error > ;
145145
146146 private firstActiveAgent ?: RemoteParticipant ;
147147
@@ -262,7 +262,7 @@ export default class LocalParticipant extends Participant {
262262
263263 private handleReconnecting = ( ) => {
264264 if ( ! this . reconnectFuture ) {
265- this . reconnectFuture = new Future < void > ( ) ;
265+ this . reconnectFuture = new Future < void , Error > ( ) ;
266266 }
267267 } ;
268268
@@ -275,15 +275,15 @@ export default class LocalParticipant extends Participant {
275275 private handleClosing = ( ) => {
276276 if ( this . reconnectFuture ) {
277277 this . reconnectFuture . promise . catch ( ( e ) => this . log . warn ( e . message , this . logContext ) ) ;
278- this . reconnectFuture ?. reject ?.( 'Got disconnected during reconnection attempt' ) ;
278+ this . reconnectFuture ?. reject ?.( new Error ( 'Got disconnected during reconnection attempt' ) ) ;
279279 this . reconnectFuture = undefined ;
280280 }
281281 if ( this . signalConnectedFuture ) {
282- this . signalConnectedFuture . reject ?.( 'Got disconnected without signal connected' ) ;
282+ this . signalConnectedFuture . reject ?.( new Error ( 'Got disconnected without signal connected' ) ) ;
283283 this . signalConnectedFuture = undefined ;
284284 }
285285
286- this . activeAgentFuture ?. reject ?.( 'Got disconnected without active agent present' ) ;
286+ this . activeAgentFuture ?. reject ?.( new Error ( 'Got disconnected without active agent present' ) ) ;
287287 this . activeAgentFuture = undefined ;
288288 this . firstActiveAgent = undefined ;
289289 } ;
@@ -293,7 +293,7 @@ export default class LocalParticipant extends Participant {
293293 this . updateInfo ( joinResponse . participant ) ;
294294 }
295295 if ( ! this . signalConnectedFuture ) {
296- this . signalConnectedFuture = new Future < void > ( ) ;
296+ this . signalConnectedFuture = new Future < void , Error > ( ) ;
297297 }
298298
299299 this . signalConnectedFuture . resolve ?.( ) ;
@@ -926,7 +926,7 @@ export default class LocalParticipant extends Participant {
926926
927927 private waitUntilEngineConnected ( ) {
928928 if ( ! this . signalConnectedFuture ) {
929- this . signalConnectedFuture = new Future < void > ( ) ;
929+ this . signalConnectedFuture = new Future < void , Error > ( ) ;
930930 }
931931 return this . signalConnectedFuture . promise ;
932932 }
@@ -2009,7 +2009,7 @@ export default class LocalParticipant extends Participant {
20092009 if ( agent ) {
20102010 this . activeAgentFuture ?. resolve ?.( agent ) ;
20112011 } else {
2012- this . activeAgentFuture ?. reject ?.( 'Agent disconnected' ) ;
2012+ this . activeAgentFuture ?. reject ?.( new Error ( 'Agent disconnected' ) ) ;
20132013 }
20142014 this . activeAgentFuture = undefined ;
20152015 }
@@ -2019,7 +2019,7 @@ export default class LocalParticipant extends Participant {
20192019 return Promise . resolve ( this . firstActiveAgent ) ;
20202020 }
20212021 if ( ! this . activeAgentFuture ) {
2022- this . activeAgentFuture = new Future < RemoteParticipant > ( ) ;
2022+ this . activeAgentFuture = new Future < RemoteParticipant , Error > ( ) ;
20232023 }
20242024 return this . activeAgentFuture . promise ;
20252025 }
0 commit comments