INVALID_NAME
What INVALID_NAME means, why InvalidInputError throws it, what to show users and how to fix it in ensforge. Also covers retry safety.
InvalidInputErrorNot retryable
@ensforge/sdk
What happened
undefined is not a valid ENS name.
What to show users
| Title | Message | Action |
|---|---|---|
| Invalid name | This is not a valid ENS name. | Check the spelling and remove unsupported characters. |
How to fix
Names must normalize under ENSIP-15, e.g. nick.eth.
Retry safety
Retrying the same call fails the same way until the cause is fixed (retryable: false).
Actions that throw it
| Action | When |
|---|---|
approval.getDelegate | for invalid input. |
approval.getToken | when the name cannot be normalized. |
approval.setDelegate | for invalid input. |
approval.setToken | for invalid input. |
dns.claim | for invalid input. |
dns.getOffchainResolver | for names that are not DNS names. |
dns.getProof | for names that are not DNS names. |
dns.getRecords | for invalid names. |
dns.getStatus | for names that are not DNS names. |
dns.setRecords | for invalid input, such as records that are not DNS wire format. |
event.get | for invalid input. |
event.watch | for invalid names. |
indexer.getEvents | for invalid input. |
indexer.getHistory | for invalid input. |
indexer.getName | when the name does not normalize. |
indexer.getNamesByExpiry | when parent does not normalize. |
indexer.getNamesForAddress | for invalid input. |
indexer.getPermissions | for invalid input. |
indexer.getRecords | for invalid input. |
indexer.getSubnames | when the name does not normalize. |
migration.get | for invalid input. |
migration.migrate | for invalid input. |
name.get | when the name is invalid or the root. |
name.reclaim | for invalid input. |
name.setManager | for invalid input. |
name.setTtl | for invalid input. |
name.transfer | for invalid input. |
permission.check | for invalid input. |
permission.get | for invalid input. |
permission.setRecordAccess | for invalid input or an unconfirmed widening. |
primaryName.get | for invalid input, or with strict an unnormalized name. |
primaryName.set | for invalid input. |
primaryName.signClaim | for invalid input. |
record.get | for invalid input. |
record.getAddress | for invalid input. |
record.getAvatar | when the name cannot be normalized. |
record.getContentHash | when the name cannot be normalized. |
record.getText | when the name cannot be normalized. |
record.set | for invalid input. |
registration.commit | for invalid input. |
registration.getPrice | for invalid input. |
registration.getRenewalPrice | for invalid input. |
registration.isAvailable | for names that are not .eth second-level names. |
registration.register | for invalid input. |
registration.renew | for invalid input. |
registry.attach | for invalid input. |
registry.deploy | for invalid input. |
registry.get | for invalid input. |
registry.setUri | for invalid input. |
registry.upgrade | for invalid input or an up-to-date registry. |
resolver.create | for invalid input, or a salt whose resolver already exists. |
resolver.get | when the name cannot be normalized. |
resolver.getLink | when the name cannot be normalized. |
resolver.link | for invalid input or a target without records. |
resolver.resolve | for an invalid name or calldata. |
resolver.set | for invalid input. |
resolver.upgrade | for invalid input or an up-to-date resolver. |
role.get | for invalid input or targets. |
role.grant | for invalid input or targets. |
role.revoke | for invalid input or targets. |
subname.create | for invalid input. |
subname.remove | for invalid input. |
subname.update | for invalid input. |
wrapper.getFuses | for invalid names. |
wrapper.setChildFuses | for invalid input or fuses. |
wrapper.setFuses | for invalid input or fuses. |
wrapper.unwrap | for invalid input. |
wrapper.wrap | for invalid input or fuses. |
Catch it
Errors.hasCode("INVALID_NAME") narrows to this error. See Handle errors.
Was this page helpful?