Skip to content

Commit

Permalink
common: log and display connectContracts original error
Browse files Browse the repository at this point in the history
  • Loading branch information
tilacog committed Sep 19, 2023
1 parent cb96035 commit b2d6437
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/indexer-common/src/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit b2d6437

Please sign in to comment.