Skip to content

Commit

Permalink
dont fail on network errors (#2171)
Browse files Browse the repository at this point in the history
  • Loading branch information
artursapek committed Jun 5, 2024
1 parent fc47b25 commit f06788d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion wormhole-connect/scripts/checkForeignAssetsConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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(
Expand All @@ -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
Expand Down

0 comments on commit f06788d

Please sign in to comment.