Skip to content

Commit

Permalink
Don't throw on dns lookup errors (#1122)
Browse files Browse the repository at this point in the history
discard dns lookup errors
  • Loading branch information
dholms authored May 31, 2023
1 parent 7566584 commit 9d33cbb
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions packages/identity/src/handle/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { isErrnoException } from '@atproto/common-web'
import dns from 'dns/promises'
import { HandleResolverOpts } from '../types'

Expand Down Expand Up @@ -43,10 +42,7 @@ export class HandleResolver {
try {
chunkedResults = await dns.resolveTxt(`${SUBDOMAIN}.${handle}`)
} catch (err) {
if (isErrnoException(err) && err.code === 'ENOTFOUND') {
return undefined
}
throw err
return undefined
}
const results = chunkedResults.map((chunks) => chunks.join(''))
const found = results.filter((i) => i.startsWith(PREFIX))
Expand Down

0 comments on commit 9d33cbb

Please sign in to comment.