File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ import * as nodesEvents from './events';
5050import * as nodesErrors from './errors' ;
5151import * as agentErrors from './agent/errors' ;
5252import NodeConnectionQueue from './NodeConnectionQueue' ;
53+ import { ErrorNodeManagerFindNodeFailed } from './errors' ;
5354import { assertClaimNetworkAuthority } from '../claims/payloads/claimNetworkAuthority' ;
5455import { assertClaimNetworkAccess } from '../claims/payloads/claimNetworkAccess' ;
5556import Token from '../tokens/Token' ;
@@ -637,7 +638,14 @@ class NodeManager {
637638 try {
638639 return await Promise . any ( [ findBySignal , findByDirect , findByMDNS ] ) ;
639640 } catch ( e ) {
640- // FIXME: check error type and throw if not connection related failure
641+ if ( e instanceof AggregateError ) {
642+ for ( const error of e . errors ) {
643+ // Checking if each error is an expected error
644+ if ( ! ( error instanceof ErrorNodeManagerFindNodeFailed ) ) throw e ;
645+ }
646+ } else if ( ! ( e instanceof ErrorNodeManagerFindNodeFailed ) ) {
647+ throw e ;
648+ }
641649 return ;
642650 } finally {
643651 abortController . abort ( abortPendingConnectionsReason ) ;
You can’t perform that action at this time.
0 commit comments