From b2d6437dae3e57388800bfd3c64585b6891b0bf5 Mon Sep 17 00:00:00 2001 From: tilacog Date: Tue, 19 Sep 2023 16:29:27 -0300 Subject: [PATCH] common: log and display connectContracts original error --- packages/indexer-common/src/network.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/indexer-common/src/network.ts b/packages/indexer-common/src/network.ts index e1383e09b..d90f1486c 100644 --- a/packages/indexer-common/src/network.ts +++ b/packages/indexer-common/src/network.ts @@ -429,10 +429,11 @@ async function connectToProtocolContracts( let contracts try { contracts = await connectContracts(wallet, numericNetworkId) - } catch (err) { - throw new Error( - `Failed to connect to contracts, please ensure you are using the intended protocol network`, - ) + } catch (error) { + const errorMessage = + 'Failed to connect to contracts, please ensure you are using the intended protocol network.' + logger.error(errorMessage, { error, networkIdentifier, numericNetworkId }) + throw new Error(`${errorMessage} Error: ${error}`) } logger.info(`Successfully connected to contracts`, { curation: contracts.curation.address,