Skip to content

This site describes solve-engine as it is on main: 2.43.0, which npm does not have yet. npm installs 2.40.0, so a page may show an answer that version does not give yet.

ErrorFactory

Defined in: packages/engine/src/errors/EngineError.ts:243

Factory for creating classified EngineErrors. Every method accepts EITHER the original, minimal 3-arg shape (code, message, context? every existing call site across the codebase keeps compiling unchanged) OR the richer EngineErrorInit object (for expected/found/ suggestion/recoverable/span/cause), upgrade a call site to the richer form only when you’re already touching it, no separate churn pass required.

new ErrorFactory(): ErrorFactory;

ErrorFactory

static config(
code,
message,
context?
): EngineError;

Defined in: packages/engine/src/errors/EngineError.ts:303

Defaults recoverable: false, and is now the only method that does: a configuration or package-registration failure is the one class that leaves no working engine to carry on with, rather than one bad line in a document.

ParameterType
codestring
messagestring
context?Record<string, unknown>

EngineError

static config(init): EngineError;

Defined in: packages/engine/src/errors/EngineError.ts:304

Defaults recoverable: false, and is now the only method that does: a configuration or package-registration failure is the one class that leaves no working engine to carry on with, rather than one bad line in a document.

ParameterType
initEngineErrorInit

EngineError


static execution(
code,
message,
context?
): EngineError;

Defined in: packages/engine/src/errors/EngineError.ts:270

ParameterType
codestring
messagestring
context?Record<string, unknown>

EngineError

static execution(init): EngineError;

Defined in: packages/engine/src/errors/EngineError.ts:271

ParameterType
initEngineErrorInit

EngineError


static external(
code,
message,
context?
): EngineError;

Defined in: packages/engine/src/errors/EngineError.ts:276

ParameterType
codestring
messagestring
context?Record<string, unknown>

EngineError

static external(init): EngineError;

Defined in: packages/engine/src/errors/EngineError.ts:277

ParameterType
initEngineErrorInit

EngineError


static internal(
code,
message,
context?
): EngineError;

Defined in: packages/engine/src/errors/EngineError.ts:296

Reserve for genuine engine-internal invariant violations (corrupted bytecode, a stack underflow from a buggy plugin, an “impossible” state), not for user-input errors: the category is a bug report.

Defaults recoverable: true all the same, because every one of these sites is an invariant that failed on ONE line and none of them leaves the engine unusable. This used to default to false, which conflated “the engine’s fault” with “the engine is finished” and told a host to tear a document down over a line it could simply have shown an error against. A site that has looked at its own case and concluded the instance really is gone can still pass recoverable: false explicitly. See EngineErrorInit.recoverable.

ParameterType
codestring
messagestring
context?Record<string, unknown>

EngineError

static internal(init): EngineError;

Defined in: packages/engine/src/errors/EngineError.ts:297

Reserve for genuine engine-internal invariant violations (corrupted bytecode, a stack underflow from a buggy plugin, an “impossible” state), not for user-input errors: the category is a bug report.

Defaults recoverable: true all the same, because every one of these sites is an invariant that failed on ONE line and none of them leaves the engine unusable. This used to default to false, which conflated “the engine’s fault” with “the engine is finished” and told a host to tear a document down over a line it could simply have shown an error against. A site that has looked at its own case and concluded the instance really is gone can still pass recoverable: false explicitly. See EngineErrorInit.recoverable.

ParameterType
initEngineErrorInit

EngineError


static parsing(
code,
message,
context?
): EngineError;

Defined in: packages/engine/src/errors/EngineError.ts:264

ParameterType
codestring
messagestring
context?Record<string, unknown>

EngineError

static parsing(init): EngineError;

Defined in: packages/engine/src/errors/EngineError.ts:265

ParameterType
initEngineErrorInit

EngineError


static validation(
code,
message,
context?
): EngineError;

Defined in: packages/engine/src/errors/EngineError.ts:258

ParameterType
codestring
messagestring
context?Record<string, unknown>

EngineError

static validation(init): EngineError;

Defined in: packages/engine/src/errors/EngineError.ts:259

ParameterType
initEngineErrorInit

EngineError