> ## Documentation Index
> Fetch the complete documentation index at: https://botmesh.afaya.com.co/llms.txt
> Use this file to discover all available pages before exploring further.

# StaleLeaseError

> Class exported by @botmesh/core/spi.

Defined in: [durability/errors.ts:16](https://github.com/andresayac/botmesh/blob/main/packages/core/src/durability/errors.ts#L16)

A journal completion (`ack`, `fail`, `markSent`, …) presented a fencing token that is
not the record's current claim: the lease expired and someone else re-claimed the
record, or it already left the leased state. The stale holder must drop its result.

## Extends

* `Error`

## Constructors

### Constructor

```ts theme={null}
new StaleLeaseError(
   id, 
   fencingToken, 
   currentToken, 
   state
): StaleLeaseError;
```

Defined in: [durability/errors.ts:17](https://github.com/andresayac/botmesh/blob/main/packages/core/src/durability/errors.ts#L17)

#### Parameters

| Parameter | Type | Description |
| - | - | - |
| `id` | `string` | Inbox record id or outbox key. |
| `fencingToken` | `number` | The token that was presented. |
| `currentToken` | `number` | The record's current token (`-1` when the record does not exist). |
| `state` | `string` | The record's current state (`'missing'` when it does not exist). |

#### Returns

`StaleLeaseError`

#### Overrides

`Error.constructor`

## Properties

### id

```ts theme={null}
readonly id: string;
```

Defined in: [durability/errors.ts:19](https://github.com/andresayac/botmesh/blob/main/packages/core/src/durability/errors.ts#L19)

Inbox record id or outbox key.

***

### fencingToken

```ts theme={null}
readonly fencingToken: number;
```

Defined in: [durability/errors.ts:21](https://github.com/andresayac/botmesh/blob/main/packages/core/src/durability/errors.ts#L21)

The token that was presented.

***

### currentToken

```ts theme={null}
readonly currentToken: number;
```

Defined in: [durability/errors.ts:23](https://github.com/andresayac/botmesh/blob/main/packages/core/src/durability/errors.ts#L23)

The record's current token (`-1` when the record does not exist).

***

### state

```ts theme={null}
readonly state: string;
```

Defined in: [durability/errors.ts:25](https://github.com/andresayac/botmesh/blob/main/packages/core/src/durability/errors.ts#L25)

The record's current state (`'missing'` when it does not exist).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.