Skip to content

Documentation / @etherfold/core / GenerationCapReachedError

Class: GenerationCapReachedError ​

Defined in: packages/core/src/generation/registry.ts:396

A cap reached: the new generation is REFUSED, and what could be deleted to make room is NAMED.

It never evicts, and that is the decision. Eviction picks a victim by a policy that cannot know which generation an operator was deliberately keeping -- and keeping a superseded generation so the pointer can move BACK to it is the whole reason non-canonical generations are retained. A refusal costs one operator action; a wrong eviction costs a re-index, which on a public node, where old logs are frequently not served at all, may not even be available.

So the candidates are EVERY generation that may be deleted (every one that is not canonical) rather than a chosen one. Naming them is information; picking one would be the policy this refuses to have.

Extends ​

  • Error

Constructors ​

Constructor ​

new GenerationCapReachedError(cap, limit, refused, candidates, candidateStreams): GenerationCapReachedError

Defined in: packages/core/src/generation/registry.ts:399

Parameters ​

cap ​

"maxGenerations" | "maxStreams"

Which cap: a COUNT of generations, or a COUNT of streams.

limit ​

number

The configured number this indexer may not exceed.

refused ​

GenerationId

The generation that was refused. Nothing was written for it.

candidates ​

readonly GenerationId[]

Every generation that CAN be deleted: all of them but the canonical one.

candidateStreams ​

readonly string[]

Every stream deleteStream would accept: those holding no canonical generation.

Returns ​

GenerationCapReachedError

Overrides ​

Error.constructor

Properties ​

candidates ​

readonly candidates: readonly GenerationId[]

Defined in: packages/core/src/generation/registry.ts:407

Every generation that CAN be deleted: all of them but the canonical one.


candidateStreams ​

readonly candidateStreams: readonly string[]

Defined in: packages/core/src/generation/registry.ts:409

Every stream deleteStream would accept: those holding no canonical generation.


cap ​

readonly cap: "maxGenerations" | "maxStreams"

Defined in: packages/core/src/generation/registry.ts:401

Which cap: a COUNT of generations, or a COUNT of streams.


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


limit ​

readonly limit: number

Defined in: packages/core/src/generation/registry.ts:403

The configured number this indexer may not exceed.


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: "GenerationCapReachedError" = 'GenerationCapReachedError'

Defined in: packages/core/src/generation/registry.ts:397

Overrides ​

Error.name


refused ​

readonly refused: GenerationId

Defined in: packages/core/src/generation/registry.ts:405

The generation that was refused. Nothing was written for it.


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