From 963591a348484e915afa623fe1ee4f3951929072 Mon Sep 17 00:00:00 2001 From: Aiden <30964272+0xaaiden@users.noreply.github.com> Date: Thu, 23 Jan 2025 09:44:53 -0500 Subject: [PATCH] Refactor error handling in `src/strategies/spooky-lp-sonic/index.ts` * Remove try-catch block around subgraphRequest --- src/strategies/spooky-lp-sonic/index.ts | 33 +++++++++++-------------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/src/strategies/spooky-lp-sonic/index.ts b/src/strategies/spooky-lp-sonic/index.ts index bac18f48e..ea9477e6f 100644 --- a/src/strategies/spooky-lp-sonic/index.ts +++ b/src/strategies/spooky-lp-sonic/index.ts @@ -65,27 +65,22 @@ export async function strategy( params.burns.__args.where.transaction_ = { blockNumber_lte: snapshot }; } - try { - const result = await subgraphRequest(subgraphURL, params); - if (result && (result.mints || result.burns)) { - const mints = result.mints; - const burns = result.burns; + const result = await subgraphRequest(subgraphURL, params); + if (result && (result.mints || result.burns)) { + const mints = result.mints; + const burns = result.burns; - mints.forEach((mint) => { - const userAddress = getAddress(mint.origin); - const amount = parseFloat(mint.amount); - score[userAddress] += amount; - }); + mints.forEach((mint) => { + const userAddress = getAddress(mint.origin); + const amount = parseFloat(mint.amount); + score[userAddress] += amount; + }); - burns.forEach((burn) => { - const userAddress = getAddress(burn.origin); - const amount = parseFloat(burn.amount); - score[userAddress] -= amount; - }); - } - } catch (error) { - // console.error(`Error querying pool ${poolId}:`, error); - continue; + burns.forEach((burn) => { + const userAddress = getAddress(burn.origin); + const amount = parseFloat(burn.amount); + score[userAddress] -= amount; + }); } }