Skip to content

Commit

Permalink
fix don't report unactionable w3name request errors to Sentry
Browse files Browse the repository at this point in the history
  • Loading branch information
juliangruber committed Dec 17, 2024
1 parent 03f4971 commit 1c4d6ad
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
9 changes: 8 additions & 1 deletion lib/contracts.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,13 @@ async function getContractsWithRetry ({ provider }) {

async function getContractAddresses () {
const name = Name.parse(CONTRACT_ADDRESSES_IPNS_KEY)
const revision = await Name.resolve(name)
let revision
try {
revision = await Name.resolve(name)
} catch (err) {
// These errors aren't actionable
err.reportToSentry = false
throw err
}
return revision.value.split('\n').filter(Boolean)
}
9 changes: 8 additions & 1 deletion lib/modules.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,14 @@ export const installBinaryModule = async ({

async function getLatestCID (ipnsKey) {
const name = Name.parse(ipnsKey)
const revision = await Name.resolve(name)
let revision
try {
revision = await Name.resolve(name)
} catch (err) {
// These errors aren't actionable
err.reportToSentry = false
throw err
}
// /ipfs/:cid
return revision.value.split('/').pop()
}
Expand Down

0 comments on commit 1c4d6ad

Please sign in to comment.