Skip to content

Commit 1b82778

Browse files
committed
Don't throw on fail to resolve DNS
1 parent 3ee153e commit 1b82778

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

packages/core/deno.jsonc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@lpm/core",
3-
"version": "0.2.5",
3+
"version": "0.2.6",
44
"license": "MIT",
55
"exports": "./mod.ts",
66

packages/core/src/nsid-authority.ts

+8-3
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,14 @@ export class NSIDAuthorityService {
2929
)
3030
: nsidOrPattern;
3131

32-
const record = await this.dnsServicer.resolveTxt(
33-
`_lexicon.${nsid.authority}`,
34-
);
32+
let record;
33+
try {
34+
record = await this.dnsServicer.resolveTxt(
35+
`_lexicon.${nsid.authority}`,
36+
);
37+
} catch (_) {
38+
return null;
39+
}
3540

3641
const authorityDid = record.join("").replace(/^did=/, "");
3742

0 commit comments

Comments
 (0)