Try it Live
Run ENS examples in the interactive playground
ENS Errors
Which functions throw
Every ENSIP-15 failure surfaces as
DisallowedCharacterError, including script mixtures, confusables, empty labels, and label extensions. The specific reason is in error.cause.message.DisallowedCharacterError
InvalidFormatError → ValidationError → PrimitiveError → AbstractError → Error.
Reading the reason
@adraffy/ens-normalize 1.11.1:
These strings come from the third-party library and can change between its versions. Do not build control flow on exact wording.
Matching the error
Useinstanceof or name. Do not use _tag: it is "InvalidFormatError" for every Ens error class.
Exported but not thrown
The module also exports five error classes with the same constructor shape and the same base class. No Ens function throws them today; they exist so callers can construct ENSIP-15-specific errors.
All default
code to -32602.

