@@ -491,7 +491,7 @@ class NodeConnectionManager {
491
491
await Promise . all ( destroyProms ) ;
492
492
await this . quicServer . stop ( { force : true } ) ;
493
493
await this . quicSocket . stop ( { force : true } ) ;
494
- await this . rpcServer ?. destroy ( { force : true , reason : Error ( 'TMP NCM stopping' ) } ) ; // TODO
494
+ await this . rpcServer ?. destroy ( { force : true , reason : new nodesErrors . ErrorNodeConnectionManagerStopping ( ) } ) ;
495
495
this . logger . info ( `Stopped ${ this . constructor . name } ` ) ;
496
496
}
497
497
@@ -740,7 +740,7 @@ class NodeConnectionManager {
740
740
) : Promise < Map < NodeIdString , ConnectionAndTimer > > {
741
741
const nodesEncoded = nodeIds . map ( ( v ) => nodesUtils . encodeNodeId ( v ) ) ;
742
742
this . logger . debug ( `getting multi-connection for ${ nodesEncoded } ` ) ;
743
- if ( nodeIds . length === 0 ) throw Error ( 'TMP, must provide at least 1 node' ) ;
743
+ if ( nodeIds . length === 0 ) throw new nodesErrors . ErrorNodeConnectionManagerNodeIdRequired ( ) ;
744
744
const connectionsResults : Map < NodeIdString , ConnectionAndTimer > = new Map ( ) ;
745
745
// 1. short circuit any existing connections
746
746
const nodesShortlist : Set < NodeIdString > = new Set ( ) ;
@@ -816,9 +816,12 @@ class NodeConnectionManager {
816
816
await Promise . allSettled ( connProms ) ;
817
817
}
818
818
if ( connectionsResults . size === 0 ) {
819
- // TODO: This needs to throw if none were established.
820
- // The usual use case is a single node, this shouldn't be a aggregate error type.
821
- throw Error ( 'TMP No connections established!' ) ;
819
+ throw new nodesErrors . ErrorNodeConnectionManagerMultiConnectionFailed (
820
+ undefined ,
821
+ {
822
+ cause : new AggregateError ( await Promise . allSettled ( connProms ) )
823
+ }
824
+ ) ;
822
825
}
823
826
return connectionsResults ;
824
827
}
@@ -885,6 +888,8 @@ class NodeConnectionManager {
885
888
// 3. if already exists then clean up
886
889
await connection . destroy ( { force : true } ) ;
887
890
// I can only see this happening as a race condition with creating a forward connection and receiving a reverse.
891
+ // FIXME: only here to see if this condition happens.
892
+ // this NEEDS to be removed, but I want to know if this branch happens at all.
888
893
throw Error (
889
894
'TMP IMP, This should be exceedingly rare, lets see if it happens' ,
890
895
) ;
0 commit comments