# RootPermissionOnlyError

> Error class for when a root permission is added to a permission builder.

{/* This file is auto-generated by TypeDoc. Do not edit manually. */}

Defined in: [packages/smart-accounts/src/errors/permissionBuilderErrors.ts:13](https://github.com/alchemyplatform/aa-sdk/blob/v5.x.x/packages/smart-accounts/src/errors/permissionBuilderErrors.ts#L13)

Error class for when a root permission is added to a permission builder.

## Extends

- [`PermissionBuilderError`](PermissionBuilderError)

## Constructors

### Constructor

```ts
new RootPermissionOnlyError(permission): RootPermissionOnlyError;
```

Defined in: [packages/smart-accounts/src/errors/permissionBuilderErrors.ts:21](https://github.com/alchemyplatform/aa-sdk/blob/v5.x.x/packages/smart-accounts/src/errors/permissionBuilderErrors.ts#L21)

Constructor for initializing an error message indicating that the root permission cannot be combined with other permissions.

#### Parameters

<table>
  <thead>
    <tr>
      <th align="left">Parameter</th>
      <th align="left">Type</th>
      <th align="left">Description</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `permission`
      </td>

      <td>
        [`Permission`](../type-aliases/Permission)
      </td>

      <td>
        The permission trying to be added atop the root permission
      </td>
    </tr>

  </tbody>
</table>

#### Returns

`RootPermissionOnlyError`

#### Overrides

```ts
PermissionBuilderError.constructor;
```

## Properties

<table>
  <thead>
    <tr>
      <th align="left">Property</th>
      <th align="left">Type</th>
      <th align="left">Default value</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        <a id="name" /> `name`
      </td>

      <td>
        `string`
      </td>

      <td>
        `"PermissionBuilder: RootPermissionOnlyError"`
      </td>
    </tr>

  </tbody>
</table>