# NameStateError

> For the complete documentation index, see [llms.txt](https://ensforge.com/llms.txt).

What NameStateError means, which codes it carries and how to catch it in ensforge. Lists its fields and every code. Includes how to catch it.

Source: https://ensforge.com/docs/reference/errors/name-state-error

<ApiMeta kind="Error class" summary="12 codes · @ensforge/sdk" source="packages/sdk/src/errors/classes/NameStateError.ts#L39" />

The name is in the wrong state for this operation (registered, expired, locked, …).

## Codes [#codes]

| Code | Meaning | Retryable |
| --- | --- | --- |
| [`NAME_NOT_AVAILABLE`](/docs/reference/errors/NAME_NOT_AVAILABLE) | The name is already registered. | No |
| [`NAME_NOT_REGISTERED`](/docs/reference/errors/NAME_NOT_REGISTERED) | The name is not registered. | No |
| [`NAME_RESERVED`](/docs/reference/errors/NAME_RESERVED) | The name is reserved. | No |
| [`NAME_EXPIRED`](/docs/reference/errors/NAME_EXPIRED) | The name has expired. | No |
| [`NAME_NOT_RENEWABLE`](/docs/reference/errors/NAME_NOT_RENEWABLE) | The name cannot be renewed. | No |
| [`NAME_LOCKED`](/docs/reference/errors/NAME_LOCKED) | The name is locked. | No |
| [`NAME_NOT_WRAPPED`](/docs/reference/errors/NAME_NOT_WRAPPED) | The name is not wrapped in the NameWrapper. | No |
| [`NAME_WRAPPED`](/docs/reference/errors/NAME_WRAPPED) | The name is already wrapped in the NameWrapper. | No |
| [`NAME_UNREACHABLE`](/docs/reference/errors/NAME_UNREACHABLE) | ENSv2 resolution no longer reaches this ENSv1 name. | No |
| [`NAME_REQUIRES_MIGRATION`](/docs/reference/errors/NAME_REQUIRES_MIGRATION) | The name must be migrated to ENSv2 first. | No |
| [`PARENT_NOT_MIGRATED`](/docs/reference/errors/PARENT_NOT_MIGRATED) | The parent name has not been migrated to ENSv2. | No |
| [`REGISTRY_NOT_EMANCIPATED`](/docs/reference/errors/REGISTRY_NOT_EMANCIPATED) | The registry is not emancipated, so this transfer is unsafe. | No |

## Catch it [#catch-it]

`Effect.catchTag("NameStateError", …)` or `error instanceof Errors.NameStateError`. See [Handle errors](/docs/sdk/handle-errors).