# UncageError

<!-- https://uncage.vercel.app/docs/api/core/classes/uncageerror/ -->

Defined in: core/src/errors.ts:3

## Extends

- `Error`

## Constructors

### Constructor

```ts
new UncageError(code, opts?): UncageError;
```

Defined in: core/src/errors.ts:10

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `code` | \| `"runtime_unavailable"` \| `"auth_required"` \| `"unsupported_capability"` \| `"invalid_workspace"` \| `"session_busy"` \| `"session_read_only"` \| `"not_found"` \| `"unauthorized"` \| `"forbidden_origin"` \| `"invalid_request"` \| `"approval_expired"` \| `"approval_already_resolved"` \| `"event_replay_unavailable"` \| `"runtime_disconnected"` \| `"policy_denied"` \| `"store_locked"` \| `"attachment_too_large"` \| `"attachment_type_unsupported"` \| `"machine_offline"` \| `"machine_not_found"` \| `"upgrade_required"` \| `"tool_failed"` \| `"device_code_expired"` \| `"rate_limited"` \| `"internal_error"` |
| `opts?` | \{ `cause?`: `unknown`; `details?`: `Record`\<`string`, `unknown`\>; `hint?`: `string`; `message?`: `string`; \} |
| `opts.cause?` | `unknown` |
| `opts.details?` | `Record`\<`string`, `unknown`\> |
| `opts.hint?` | `string` |
| `opts.message?` | `string` |

#### Returns

`UncageError`

#### Overrides

`Error.constructor`

## Properties

### code

```ts
code: 
  | "runtime_unavailable"
  | "auth_required"
  | "unsupported_capability"
  | "invalid_workspace"
  | "session_busy"
  | "session_read_only"
  | "not_found"
  | "unauthorized"
  | "forbidden_origin"
  | "invalid_request"
  | "approval_expired"
  | "approval_already_resolved"
  | "event_replay_unavailable"
  | "runtime_disconnected"
  | "policy_denied"
  | "store_locked"
  | "attachment_too_large"
  | "attachment_type_unsupported"
  | "machine_offline"
  | "machine_not_found"
  | "upgrade_required"
  | "tool_failed"
  | "device_code_expired"
  | "rate_limited"
  | "internal_error";
```

Defined in: core/src/errors.ts:4

***

### details?

```ts
details?: Record<string, unknown>;
```

Defined in: core/src/errors.ts:8

***

### hint?

```ts
hint?: string;
```

Defined in: core/src/errors.ts:5

***

### retryable

```ts
retryable: boolean;
```

Defined in: core/src/errors.ts:6

***

### status

```ts
status: number;
```

Defined in: core/src/errors.ts:7

## Methods

### toBody()

```ts
toBody(requestId?): object;
```

Defined in: core/src/errors.ts:24

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `requestId?` | `string` |

#### Returns

`object`

| Name | Type | Defined in |
| ------ | ------ | ------ |
| `code` | \| `"runtime_unavailable"` \| `"auth_required"` \| `"unsupported_capability"` \| `"invalid_workspace"` \| `"session_busy"` \| `"session_read_only"` \| `"not_found"` \| `"unauthorized"` \| `"forbidden_origin"` \| `"invalid_request"` \| `"approval_expired"` \| `"approval_already_resolved"` \| `"event_replay_unavailable"` \| `"runtime_disconnected"` \| `"policy_denied"` \| `"store_locked"` \| `"attachment_too_large"` \| `"attachment_type_unsupported"` \| `"machine_offline"` \| `"machine_not_found"` \| `"upgrade_required"` \| `"tool_failed"` \| `"device_code_expired"` \| `"rate_limited"` \| `"internal_error"` | protocol/dist/index.d.ts:39 |
| `details?` | `Record`\<`string`, `unknown`\> | protocol/dist/index.d.ts:69 |
| `hint?` | `string` | protocol/dist/index.d.ts:67 |
| `message` | `string` | protocol/dist/index.d.ts:66 |
| `requestId?` | `string` | protocol/dist/index.d.ts:70 |
| `retryable` | `boolean` | protocol/dist/index.d.ts:68 |
