Skip to content

Documentation / @etherfold/core / WireContextMismatchError

Class: WireContextMismatchError ​

Defined in: packages/core/src/errors.ts:136

A batch that belongs to a different indexer.

context.source and context.config are asserted by the SENDER and checked on every batch, because the alternative is silently corrupted state: logs for one source folded into the state of another, discovered later as a wrong answer with nothing pointing at the cause. It is the wire-side half of the hole docs/reviews/todo-triage.md found in every persistence layer.

Deliberately NOT an UnexpectedFromBlockError, and the distinction is operational rather than cosmetic. A cursor refusal is RECOVERABLE by the sender on its own: re-send from the block named. A context mismatch is a misconfiguration, and no block number makes it right; a sender that treated the two alike would retry forever against a server that will never accept it.

context.processor is absent from what is checked here, because the sender cannot assert it: it has no idea which processor version runs on this side. The receiver owns that third identity and checks it against its own persisted cursor instead (see StreamBuilder).

Extends ​

  • Error

Constructors ​

Constructor ​

new WireContextMismatchError(expected, received): WireContextMismatchError

Defined in: packages/core/src/errors.ts:140

Parameters ​

expected ​

WireContext

The {source, config} this receiver indexes.

received ​

WireContext

The {source, config} the batch claimed.

Returns ​

WireContextMismatchError

Overrides ​

Error.constructor

Properties ​

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


expected ​

readonly expected: WireContext

Defined in: packages/core/src/errors.ts:142

The {source, config} this receiver indexes.


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

Defined in: packages/core/src/errors.ts:137

Overrides ​

Error.name


received ​

readonly received: WireContext

Defined in: packages/core/src/errors.ts:144

The {source, config} the batch claimed.


retryable ​

readonly retryable: false = false

Defined in: packages/core/src/errors.ts:138


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