From 962a239a9b54248c2f286cdba15d3950f1a6b2b3 Mon Sep 17 00:00:00 2001 From: abefernan <44572727+abefernan@users.noreply.github.com> Date: Mon, 17 Apr 2023 16:40:15 +0200 Subject: [PATCH] Fix try catch in for loop --- components/chainSelect/ChainSelect.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/components/chainSelect/ChainSelect.tsx b/components/chainSelect/ChainSelect.tsx index b9aaca4..3f1150b 100644 --- a/components/chainSelect/ChainSelect.tsx +++ b/components/chainSelect/ChainSelect.tsx @@ -181,14 +181,14 @@ const ChainSelect = () => { throw new Error("No SSL enabled RPC nodes available for this chain"); } - try { - for (const node of secureNodes) { + for (const node of secureNodes) { + try { // test client connection const client = await StargateClient.connect(node); await client.getHeight(); return node; - } - } catch {} + } catch {} + } throw new Error("No RPC nodes available for this chain"); };