Skip to content

Commit

Permalink
Merge pull request #363 from algorandfoundation/asset-meta-fetch
Browse files Browse the repository at this point in the history
fix: handle and log error when failing to fetch asset metadata
  • Loading branch information
neilcampbell authored Dec 10, 2024
2 parents 81590b4 + d083100 commit ef7f783
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/features/assets/data/asset-metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ const createAssetMetadataResult = async (

if (metadataUrl) {
const gatewayMetadataUrl = replaceIpfsWithGatewayIfNeeded(metadataUrl)
const response = await fetch(gatewayMetadataUrl)
try {
const response = await fetch(gatewayMetadataUrl)
const { localization: _localization, ...metadata } = await response.json()
arc3MetadataResult = {
metadata_url: gatewayMetadataUrl,
Expand Down Expand Up @@ -78,7 +78,8 @@ const createAssetMetadataResult = async (
}
}
} else {
throw error
// eslint-disable-next-line no-console
console.error('failed to fetch asset metadata')
}
}
}
Expand Down

0 comments on commit ef7f783

Please sign in to comment.