Skip to content

Commit 80f62ef

Browse files
committed
Throw more desscriptive error for unconfigured ENS name contract targets (#4213).
1 parent 7d061b7 commit 80f62ef

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src.ts/contract/contract.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,11 @@ export class BaseContract implements Addressable, EventEmitterable<ContractEvent
695695
}
696696

697697
addrPromise = resolver.resolveName(target).then((addr) => {
698-
if (addr == null) { throw new Error("TODO"); }
698+
if (addr == null) {
699+
throw makeError("an ENS name used for a contract target must be correctly configured", "UNCONFIGURED_NAME", {
700+
value: target
701+
});
702+
}
699703
getInternal(this).addr = addr;
700704
return addr;
701705
});

0 commit comments

Comments
 (0)