MISSING_ROLES
What MISSING_ROLES means, why UnauthorizedError throws it, what to show users and how to fix it in ensforge. Also covers retry safety.
UnauthorizedErrorNot retryable
@ensforge/sdk
What happened
The account is missing the roles this change needs.
What to show users
| Title | Message | Action |
|---|---|---|
| Permission needed | Your account is not allowed to make this change to this name. | Ask the owner for permission. |
How to fix
Ask the name's owner to grant the roles, or send from the owner's account.
Retry safety
Retrying the same call fails the same way until the cause is fixed (retryable: false).
Actions that throw it
| Action | When |
|---|---|
record.set | when the account may not edit records. |
registry.attach | when the account may not change it. |
registry.deploy | when the account may not set the name's subregistry. |
registry.setUri | without the setUri root role. |
registry.upgrade | without the upgrade root role. |
resolver.create | when the account may not point the name at it. |
resolver.link | without the link role. |
resolver.set | when the account may not change it. |
resolver.upgrade | without the upgrade role. |
subname.create | when the account may not create children. |
subname.remove | when the account may not remove it. |
subname.update | when the account may not change it. |
Catch it
Errors.hasCode("MISSING_ROLES") narrows to this error. See Handle errors.
Was this page helpful?