Skip to content

Rulvar API reference


Rulvar API reference / @rulvar/core / SettlementError

Class: SettlementError

Defined in: packages/core/src/l0/errors.ts:405

The segment computed its outcome but a settlement write failed with a NON-fencing store error, so nothing durable records that the run settled. handle.result rejects with this instead of resolving, because a caller acting on an unrecorded outcome is exactly the split view an authoritative store exists to prevent. stage names the write that failed: 'run-settle' is the journal decision entry (when it fails the terminal meta write is SKIPPED, so the projection can never run ahead of the journal), 'meta' is the terminal RunMeta projection (the journal settle IS durable; only the projection is behind, the same residue a crash between the two writes leaves). Every entry the run appended before settlement is already durable, so recovery is deterministic: resume the run and replay re-settles the same outcome without a provider call, or reconcile the store with rulvar runs audit [--repair]. A superseded segment's fencing rejection of the settle append (LeaseHeldError) is NOT this error: it rejects with the typed SupersededError (RV1009), while a meta-only lease bounce over an already durable settle stays swallowed (the journal records the outcome; only the projection belongs to the current holder). data records { runId, runStatus, stage }.

Extends

Constructors

Constructor

ts
new SettlementError(message, opts): SettlementError;

Defined in: packages/core/src/l0/errors.ts:413

Parameters

ParameterType
messagestring
opts{ cause?: unknown; runId: string; runStatus: string; stage: "run-settle" | "meta"; }
opts.cause?unknown
opts.runIdstring
opts.runStatusstring
opts.stage"run-settle" | "meta"

Returns

SettlementError

Overrides

RulvarError.constructor

Properties

PropertyModifierTypeDescriptionOverridesInherited fromDefined in
codereadonly"settlement"-RulvarError.code-packages/core/src/l0/errors.ts:406
data?readonlyJson--RulvarError.datapackages/core/src/l0/errors.ts:64
retryablereadonlyboolean--RulvarError.retryablepackages/core/src/l0/errors.ts:63
runIdreadonlystring---packages/core/src/l0/errors.ts:409
runStatusreadonlystringThe outcome status the segment computed and could not record.--packages/core/src/l0/errors.ts:411
stagereadonly"run-settle" | "meta"The settlement write that failed first.--packages/core/src/l0/errors.ts:408

Methods

toWire()

ts
toWire(): WireError;

Defined in: packages/core/src/l0/errors.ts:75

Returns

WireError

Inherited from

RulvarError.toWire