From f06788d3bdb5f509bf1296db63cf2eaf5d459bb9 Mon Sep 17 00:00:00 2001 From: Artur Sapek Date: Tue, 4 Jun 2024 14:16:38 -0400 Subject: [PATCH] dont fail on network errors (#2171) --- wormhole-connect/scripts/checkForeignAssetsConfig.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/wormhole-connect/scripts/checkForeignAssetsConfig.ts b/wormhole-connect/scripts/checkForeignAssetsConfig.ts index 4e8b9f572..91ce9ae9f 100644 --- a/wormhole-connect/scripts/checkForeignAssetsConfig.ts +++ b/wormhole-connect/scripts/checkForeignAssetsConfig.ts @@ -49,6 +49,7 @@ const checkEnvConfig = async ( Object.keys(chainsConfig).map((unTypedChain) => { return (async () => { const chain = unTypedChain as ChainName; + const configForeignAddress = tokenConfig.foreignAssets?.[chain]; if (chain === tokenConfig.nativeChain) { if (configForeignAddress) { @@ -64,7 +65,10 @@ const checkEnvConfig = async ( chain, ); } catch (e: any) { - if (WORMCHAIN_ERROR_MESSAGES.includes(e?.message)) { + if ( + WORMCHAIN_ERROR_MESSAGES.includes(e?.message) || + e?.message.includes('NETWORK_ERROR') + ) { // do not throw on wormchain errors } else { console.error( @@ -82,6 +86,7 @@ const checkEnvConfig = async ( } catch (e: any) { if ( /denom trace for ibc\/\w+ not found/gi.test(e?.message) || + e?.message.includes("Can't fetch decimals") || e?.message.includes('Bad status on response: 429') ) { // denom trace not found means the asset has not yet been bridged to the target chain