Skip to content

LoadQuorumFailedError

Defined in: packages/core/src/load-quorum.ts:460

Error thrown by PeerborneDocument.load() when the initial-load quorum gate fails — i.e. fewer than Q peers agreed on a state digest within the configured timeout. Applications should catch this and either retry later (peers may converge), surface the failure to the user, or fall back to an explicit loadQuorumEnabled: false path if they have an out-of-band trust model.

The 'invalid-config' reason is a special case that surfaces an operator misconfiguration (e.g. loadQuorumK <= 0) rather than a runtime quorum failure: retrying without fixing the config will not help. See the docstring on LoadQuorumFailedReason for the full reason set.

Defined here (alongside the pure decision logic) so callers can instanceof test without importing the heavy PeerborneDocument module.

  • Error

new LoadQuorumFailedError(opts): LoadQuorumFailedError

Defined in: packages/core/src/load-quorum.ts:493

ReadonlyMap<string, string>

Per-peer bind-failure record. Only meaningful when reason === 'bind-check-failed-all-agreeing-peers'; ignored otherwise.

ReadonlyMap<string, number>

string

Free-form detail string used by the 'invalid-config' reason to carry the offending value into the operator-visible error message (e.g. loadQuorumK must be a positive integer; got NaN). Non-finite numbers render as their JS literal ('NaN' / 'Infinity' / '-Infinity') via formatConfigValue, not the misleading 'null' that JSON.stringify produces. Ignored for the other reasons, which compose the detail string from the structured fields.

string

LoadQuorumFailedReason

number

number

LoadQuorumFailedError

Error.constructor

readonly agreeingPeerBindFailures: ReadonlyMap<string, string>

Defined in: packages/core/src/load-quorum.ts:484

For reason === 'bind-check-failed-all-agreeing-peers': a map from peer-id (as _peerIdOf extracts it) to the advertised tipsHash hex that peer served on its full-load response (or the sentinel '(missing tips)' when the responder omitted the tips array). Lets callers and operators see WHICH peers in the agreeing cohort equivocated between the probe round and the load round, and what they served instead. Empty for all other reasons.


readonly agreement: ReadonlyMap<string, number>

Defined in: packages/core/src/load-quorum.ts:476

Snapshot of (hash hex -> vote count) at the moment of failure, used for observability. Empty when no peer responded.


optional cause?: unknown

Defined in: node_modules/typescript/lib/lib.es2022.error.d.ts:26

Error.cause


readonly optional detail?: string

Defined in: packages/core/src/load-quorum.ts:491

Structured detail string for the 'invalid-config' reason (e.g. loadQuorumK must be a positive integer; got NaN). Exposed as a field so callers (notably runLoadQuorum’s post-init guard) can forward the validator’s structured wording into a rethrown error with a different documentPath WITHOUT regex-parsing error.message. Empty/undefined for all other reasons.


readonly documentPath: string

Defined in: packages/core/src/load-quorum.ts:462

The document path the quorum was being computed for.


message: string

Defined in: node_modules/typescript/lib/lib.es5.d.ts:1077

Error.message


name: string

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

Error.name


readonly reason: LoadQuorumFailedReason

Defined in: packages/core/src/load-quorum.ts:466

Why quorum failed — mirrors LoadQuorumDecision.reason on the failure case so callers can branch on the specific failure mode. See LoadQuorumFailedReason for the full set.


readonly requiredQ: number

Defined in: packages/core/src/load-quorum.ts:473

The effective Q threshold the loader was holding peers to.


readonly respondingCount: number

Defined in: packages/core/src/load-quorum.ts:471

Number of peers that returned a signer-attributed vote. Timeouts and declines do NOT increment this. Used to distinguish 'insufficient-responses' (< Q peers responded at all) from 'no-agreement' (≥ Q responded but no single bucket reached Q).


optional stack?: string

Defined in: node_modules/typescript/lib/lib.es5.d.ts:1078

Error.stack


static stackTraceLimit: number

Defined in: node_modules/@types/node/globals.d.ts:67

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.

Error.stackTraceLimit

static captureStackTrace(targetObject, constructorOpt?): void

Defined in: node_modules/@types/node/globals.d.ts:51

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

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:

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();

object

Function

void

Error.captureStackTrace

static captureStackTrace(targetObject, constructorOpt?): void

Defined in: node_modules/@types/multicast-dns/node_modules/@types/node/globals.d.ts:136

Create .stack property on a target object

object

Function

void

Error.captureStackTrace


static isError(error): error is Error

Defined in: node_modules/typescript/lib/lib.esnext.error.d.ts:23

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

unknown

error is Error

Error.isError


static optional prepareStackTrace(err, stackTraces): any

Defined in: node_modules/@types/node/globals.d.ts:55

Error

CallSite[]

any

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

Error.prepareStackTrace