[API reference](https://jsprismarine.dev/api/index.md) / [@jsprismarine/script-host](https://jsprismarine.dev/api/@jsprismarine/script-host/index.md) / errors

# errors

## Classes

- [NotImplementedError](https://jsprismarine.dev/api/@jsprismarine/script-host/errors/classes/NotImplementedError.md)
- [ScriptApiError](https://jsprismarine.dev/api/@jsprismarine/script-host/errors/classes/ScriptApiError.md)

## Interfaces

### ScriptApiMemberName

Defined in: [script-host/src/errors.ts:21](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/script-host/src/errors.ts#L21)

Where a Script API member sits: its module, its class (empty for a module function) and its name.

#### Properties

##### member

> `readonly` **member**: `string`

Defined in: [script-host/src/errors.ts:25](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/script-host/src/errors.ts#L25)

##### module

> `readonly` **module**: `string`

Defined in: [script-host/src/errors.ts:22](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/script-host/src/errors.ts#L22)

##### owner

> `readonly` **owner**: `string`

Defined in: [script-host/src/errors.ts:24](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/script-host/src/errors.ts#L24)

The class or error; empty for a module-level function.

***

### ScriptErrorDetails

Defined in: [script-host/src/errors.ts:4](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/script-host/src/errors.ts#L4)

What a script's uncaught error reported: its name, message and stack as the engine saw them.

#### Properties

##### scriptMessage

> `readonly` **scriptMessage**: `string`

Defined in: [script-host/src/errors.ts:6](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/script-host/src/errors.ts#L6)

##### scriptName

> `readonly` **scriptName**: `string`

Defined in: [script-host/src/errors.ts:5](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/script-host/src/errors.ts#L5)

##### scriptStack

> `readonly` **scriptStack**: `string`

Defined in: [script-host/src/errors.ts:7](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/script-host/src/errors.ts#L7)

## Type Aliases

### ScriptApiErrorField

> **ScriptApiErrorField** = `string` \| `number` \| `boolean` \| `undefined`

Defined in: [script-host/src/errors.ts:52](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/script-host/src/errors.ts#L52)

The value of a field a Script API error carries, such as `ArgumentOutOfBoundsError.index`.

## Functions

### scriptErrorParams()

> **scriptErrorParams**(`details`): `object`

Defined in: [script-host/src/errors.ts:15](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/script-host/src/errors.ts#L15)

The values a `ScriptError` is made from: the details its fields read, and the script's error as
it prints for the message.

#### Parameters

##### details

[`ScriptErrorDetails`](#scripterrordetails)

What the engine reported.

#### Returns

`object`

##### error

> **error**: `string`

##### scriptMessage

> `readonly` **scriptMessage**: `string`

##### scriptName

> `readonly` **scriptName**: `string`

##### scriptStack

> `readonly` **scriptStack**: `string`
