Skip to content

Documentation / @etherfold/core / CanonicalGenerationNotHeldError

Class: CanonicalGenerationNotHeldError ​

Defined in: packages/core/src/container.ts:448

The registry names a canonical generation this container was not given factories for.

REFUSED rather than worked around, and the two obvious ways around it are both worse. Silently promoting the generation that WAS built would move the canonical pointer without anybody asking, which is the one thing a container that holds a revertible history must never do on its own. Running the built generation while the pointer names another would answer reads from a generation the registry says is not canonical -- silently, and exactly the staleness the indirect handle exists to prevent.

It is reachable today only across a restart against a DURABLE registry whose pointer was moved by an earlier session. Resuming several generations is the promotion policy's and the shared-stream follower's business; until they land, a caller either supplies the specs for the canonical generation or moves the pointer back before opening.

Extends ​

  • Error

Constructors ​

Constructor ​

new CanonicalGenerationNotHeldError(canonical, held): CanonicalGenerationNotHeldError

Defined in: packages/core/src/container.ts:451

Parameters ​

canonical ​

GenerationId

held ​

readonly GenerationId[]

Returns ​

CanonicalGenerationNotHeldError

Overrides ​

Error.constructor

Properties ​

canonical ​

readonly canonical: GenerationId

Defined in: packages/core/src/container.ts:452


cause? ​

optional cause?: unknown

Defined in: node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts:24

Inherited from ​

Error.cause


held ​

readonly held: readonly GenerationId[]

Defined in: packages/core/src/container.ts:453


message ​

message: string

Defined in: node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1075

Inherited from ​

Error.message


name ​

readonly name: "CanonicalGenerationNotHeldError" = 'CanonicalGenerationNotHeldError'

Defined in: packages/core/src/container.ts:449

Overrides ​

Error.name


stack? ​

optional stack?: string

Defined in: node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts:1076

Inherited from ​

Error.stack

Methods ​

isError() ​

static isError(error): error is Error

Defined in: node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.esnext.error.d.ts:21

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

Parameters ​

error ​

unknown

Returns ​

error is Error

Inherited from ​

Error.isError