Skip to content

Commit

Permalink
Throw more desscriptive error for unconfigured ENS name contract targ…
Browse files Browse the repository at this point in the history
…ets (ethers-io#4213).
  • Loading branch information
ricmoo authored and Woodpile37 committed Jan 14, 2024
1 parent cd3f215 commit 71e4dfd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src.ts/contract/contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,11 @@ export class BaseContract implements Addressable, EventEmitterable<ContractEvent
}

addrPromise = resolver.resolveName(target).then((addr) => {
if (addr == null) { throw new Error("TODO"); }
if (addr == null) {
throw makeError("an ENS name used for a contract target must be correctly configured", "UNCONFIGURED_NAME", {
value: target
});
}
getInternal(this).addr = addr;
return addr;
});
Expand Down

0 comments on commit 71e4dfd

Please sign in to comment.