Skip to content

Commit

Permalink
refactor(chain): better error when failing to resolve ens
Browse files Browse the repository at this point in the history
  • Loading branch information
estebanabaroa committed Feb 2, 2024
1 parent b5c324c commit 4ea0afa
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/lib/chain/chain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ export const getNftOwner = utils.memo(getNftOwnerNoCache, {maxSize: 5000, maxAge
export const resolveEnsTxtRecordNoCache = async (ensName: string, txtRecordName: string, chainTicker: string, chainProviderUrl?: string, chainId?: number) => {
const chainProvider = getChainProvider(chainTicker, chainProviderUrl, chainId)
const resolver = await chainProvider.getResolver(ensName)
if (!resolver) {
throw Error(`name not registered or network error`)
}
const txtRecordResult = await resolver.getText(txtRecordName)
return txtRecordResult
}
Expand Down

0 comments on commit 4ea0afa

Please sign in to comment.