File tree 2 files changed +12
-2
lines changed
connect/src/routes/tokenBridge
2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -89,7 +89,12 @@ export class AutomaticTokenBridgeRoute<N extends Network>
89
89
fromChain : ChainContext < N > ,
90
90
toChain : ChainContext < N > ,
91
91
) : Promise < TokenId [ ] > {
92
- return [ await TokenTransfer . lookupDestinationToken ( fromChain , toChain , sourceToken ) ] ;
92
+ try {
93
+ return [ await TokenTransfer . lookupDestinationToken ( fromChain , toChain , sourceToken ) ] ;
94
+ } catch ( e ) {
95
+ console . error ( `Failed to get destination token: ${ e } ` ) ;
96
+ return [ ] ;
97
+ }
93
98
}
94
99
95
100
static isProtocolSupported < N extends Network > ( chain : ChainContext < N > ) : boolean {
Original file line number Diff line number Diff line change @@ -79,7 +79,12 @@ export class TokenBridgeRoute<N extends Network>
79
79
fromChain : ChainContext < N > ,
80
80
toChain : ChainContext < N > ,
81
81
) : Promise < TokenId [ ] > {
82
- return [ await TokenTransfer . lookupDestinationToken ( fromChain , toChain , sourceToken ) ] ;
82
+ try {
83
+ return [ await TokenTransfer . lookupDestinationToken ( fromChain , toChain , sourceToken ) ] ;
84
+ } catch ( e ) {
85
+ console . error ( `Failed to get destination token: ${ e } ` ) ;
86
+ return [ ] ;
87
+ }
83
88
}
84
89
85
90
static isProtocolSupported < N extends Network > ( chain : ChainContext < N > ) : boolean {
You can’t perform that action at this time.
0 commit comments