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 (#4213).
  • Loading branch information
ricmoo committed Jul 11, 2023
1 parent 7d061b7 commit 80f62ef
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 80f62ef

Please # to comment.