Skip to content

ErrorFactory

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

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:259

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:260

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:226

ParameterType
codestring
messagestring
context?Record<string, unknown>

EngineError

static execution(init): EngineError;

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

ParameterType
initEngineErrorInit

EngineError


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

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

ParameterType
codestring
messagestring
context?Record<string, unknown>

EngineError

static external(init): EngineError;

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

ParameterType
initEngineErrorInit

EngineError


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

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

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:253

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:220

ParameterType
codestring
messagestring
context?Record<string, unknown>

EngineError

static parsing(init): EngineError;

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

ParameterType
initEngineErrorInit

EngineError


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

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

ParameterType
codestring
messagestring
context?Record<string, unknown>

EngineError

static validation(init): EngineError;

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

ParameterType
initEngineErrorInit

EngineError