[**@sora-soft/framework API Reference v2.0.0**](../README.md)

***

[@sora-soft/framework API Reference](../globals.md) / TimeoutError

# Class: TimeoutError

Defined in: [packages/framework/src/utility/TimeoutError.ts:3](https://github.com/sora-soft/sora-node/blob/b502ee5b534689cc7d2350abf8d8b0ff780961fe/packages/framework/src/utility/TimeoutError.ts#L3)

## Extends

- [`ExError`](ExError.md)

## Constructors

### Constructor

> **new TimeoutError**(): `TimeoutError`

Defined in: [packages/framework/src/utility/TimeoutError.ts:4](https://github.com/sora-soft/sora-node/blob/b502ee5b534689cc7d2350abf8d8b0ff780961fe/packages/framework/src/utility/TimeoutError.ts#L4)

#### Returns

`TimeoutError`

#### Overrides

[`ExError`](ExError.md).[`constructor`](ExError.md#constructor)

## Properties

### cause?

> `optional` **cause?**: `unknown`

Defined in: node\_modules/.pnpm/typescript@5.9.3/node\_modules/typescript/lib/lib.es2022.error.d.ts:26

#### Inherited from

[`ExError`](ExError.md).[`cause`](ExError.md#cause)

***

### message

> **message**: `string`

Defined in: node\_modules/.pnpm/typescript@5.9.3/node\_modules/typescript/lib/lib.es5.d.ts:1077

#### Inherited from

[`ExError`](ExError.md).[`message`](ExError.md#message)

***

### stack?

> `optional` **stack?**: `string`

Defined in: node\_modules/.pnpm/typescript@5.9.3/node\_modules/typescript/lib/lib.es5.d.ts:1078

#### Inherited from

[`ExError`](ExError.md).[`stack`](ExError.md#stack)

***

### stackTraceLimit

> `static` **stackTraceLimit**: `number`

Defined in: node\_modules/.pnpm/@types+node@24.12.2/node\_modules/@types/node/globals.d.ts:68

The `Error.stackTraceLimit` property specifies the number of stack frames
collected by a stack trace (whether generated by `new Error().stack` or
`Error.captureStackTrace(obj)`).

The default value is `10` but may be set to any valid JavaScript number. Changes
will affect any stack trace captured _after_ the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will
not capture any frames.

#### Inherited from

[`ExError`](ExError.md).[`stackTraceLimit`](ExError.md#stacktracelimit)

## Accessors

### args

#### Get Signature

> **get** **args**(): [`ErrorArgs`](../type-aliases/ErrorArgs.md)

Defined in: [packages/framework/src/utility/ExError.ts:42](https://github.com/sora-soft/sora-node/blob/b502ee5b534689cc7d2350abf8d8b0ff780961fe/packages/framework/src/utility/ExError.ts#L42)

##### Returns

[`ErrorArgs`](../type-aliases/ErrorArgs.md)

#### Inherited from

[`ExError`](ExError.md).[`args`](ExError.md#args)

***

### code

#### Get Signature

> **get** **code**(): `string`

Defined in: [packages/framework/src/utility/ExError.ts:30](https://github.com/sora-soft/sora-node/blob/b502ee5b534689cc7d2350abf8d8b0ff780961fe/packages/framework/src/utility/ExError.ts#L30)

##### Returns

`string`

#### Inherited from

[`ExError`](ExError.md).[`code`](ExError.md#code)

***

### level

#### Get Signature

> **get** **level**(): [`ErrorLevel`](../enumerations/ErrorLevel.md)

Defined in: [packages/framework/src/utility/ExError.ts:38](https://github.com/sora-soft/sora-node/blob/b502ee5b534689cc7d2350abf8d8b0ff780961fe/packages/framework/src/utility/ExError.ts#L38)

##### Returns

[`ErrorLevel`](../enumerations/ErrorLevel.md)

#### Inherited from

[`ExError`](ExError.md).[`level`](ExError.md#level)

***

### name

#### Get Signature

> **get** **name**(): `string`

Defined in: [packages/framework/src/utility/ExError.ts:34](https://github.com/sora-soft/sora-node/blob/b502ee5b534689cc7d2350abf8d8b0ff780961fe/packages/framework/src/utility/ExError.ts#L34)

##### Returns

`string`

#### Inherited from

[`ExError`](ExError.md).[`name`](ExError.md#name)

## Methods

### toJson()

> **toJson**(): `any`

Defined in: [packages/framework/src/utility/ExError.ts:46](https://github.com/sora-soft/sora-node/blob/b502ee5b534689cc7d2350abf8d8b0ff780961fe/packages/framework/src/utility/ExError.ts#L46)

#### Returns

`any`

#### Inherited from

[`ExError`](ExError.md).[`toJson`](ExError.md#tojson)

***

### captureStackTrace()

> `static` **captureStackTrace**(`targetObject`, `constructorOpt?`): `void`

Defined in: node\_modules/.pnpm/@types+node@24.12.2/node\_modules/@types/node/globals.d.ts:52

Creates a `.stack` property on `targetObject`, which when accessed returns
a string representing the location in the code at which
`Error.captureStackTrace()` was called.

```js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack;  // Similar to `new Error().stack`
```

The first line of the trace will be prefixed with
`${myObject.name}: ${myObject.message}`.

The optional `constructorOpt` argument accepts a function. If given, all frames
above `constructorOpt`, including `constructorOpt`, will be omitted from the
generated stack trace.

The `constructorOpt` argument is useful for hiding implementation
details of error generation from the user. For instance:

```js
function a() {
  b();
}

function b() {
  c();
}

function c() {
  // Create an error without stack trace to avoid calculating the stack trace twice.
  const { stackTraceLimit } = Error;
  Error.stackTraceLimit = 0;
  const error = new Error();
  Error.stackTraceLimit = stackTraceLimit;

  // Capture the stack trace above function b
  Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
  throw error;
}

a();
```

#### Parameters

##### targetObject

`object`

##### constructorOpt?

`Function`

#### Returns

`void`

#### Inherited from

[`ExError`](ExError.md).[`captureStackTrace`](ExError.md#capturestacktrace)

***

### fromError()

> `static` **fromError**(`err`): [`ExError`](ExError.md)

Defined in: [packages/framework/src/utility/ExError.ts:11](https://github.com/sora-soft/sora-node/blob/b502ee5b534689cc7d2350abf8d8b0ff780961fe/packages/framework/src/utility/ExError.ts#L11)

#### Parameters

##### err

`Error` \| [`ExError`](ExError.md)

#### Returns

[`ExError`](ExError.md)

#### Inherited from

[`ExError`](ExError.md).[`fromError`](ExError.md#fromerror)

***

### isError()

> `static` **isError**(`error`): `error is Error`

Defined in: node\_modules/.pnpm/typescript@5.9.3/node\_modules/typescript/lib/lib.esnext.error.d.ts:23

Indicates whether the argument provided is a built-in Error instance or not.

#### Parameters

##### error

`unknown`

#### Returns

`error is Error`

#### Inherited from

[`ExError`](ExError.md).[`isError`](ExError.md#iserror)

***

### prepareStackTrace()

> `static` **prepareStackTrace**(`err`, `stackTraces`): `any`

Defined in: node\_modules/.pnpm/@types+node@24.12.2/node\_modules/@types/node/globals.d.ts:56

#### Parameters

##### err

`Error`

##### stackTraces

`CallSite`[]

#### Returns

`any`

#### See

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

#### Inherited from

[`ExError`](ExError.md).[`prepareStackTrace`](ExError.md#preparestacktrace)
