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.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ErrorFactory(): ErrorFactory;Returns
Section titled “Returns”ErrorFactory
Methods
Section titled “Methods”config()
Section titled “config()”Call Signature
Section titled “Call Signature”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.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
code | string |
message | string |
context? | Record<string, unknown> |
Returns
Section titled “Returns”Call Signature
Section titled “Call Signature”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.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
init | EngineErrorInit |
Returns
Section titled “Returns”execution()
Section titled “execution()”Call Signature
Section titled “Call Signature”static execution( code, message, context?): EngineError;Defined in: packages/engine/src/errors/EngineError.ts:226
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
code | string |
message | string |
context? | Record<string, unknown> |
Returns
Section titled “Returns”Call Signature
Section titled “Call Signature”static execution(init): EngineError;Defined in: packages/engine/src/errors/EngineError.ts:227
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
init | EngineErrorInit |
Returns
Section titled “Returns”external()
Section titled “external()”Call Signature
Section titled “Call Signature”static external( code, message, context?): EngineError;Defined in: packages/engine/src/errors/EngineError.ts:232
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
code | string |
message | string |
context? | Record<string, unknown> |
Returns
Section titled “Returns”Call Signature
Section titled “Call Signature”static external(init): EngineError;Defined in: packages/engine/src/errors/EngineError.ts:233
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
init | EngineErrorInit |
Returns
Section titled “Returns”internal()
Section titled “internal()”Call Signature
Section titled “Call Signature”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.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
code | string |
message | string |
context? | Record<string, unknown> |
Returns
Section titled “Returns”Call Signature
Section titled “Call Signature”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.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
init | EngineErrorInit |
Returns
Section titled “Returns”parsing()
Section titled “parsing()”Call Signature
Section titled “Call Signature”static parsing( code, message, context?): EngineError;Defined in: packages/engine/src/errors/EngineError.ts:220
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
code | string |
message | string |
context? | Record<string, unknown> |
Returns
Section titled “Returns”Call Signature
Section titled “Call Signature”static parsing(init): EngineError;Defined in: packages/engine/src/errors/EngineError.ts:221
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
init | EngineErrorInit |
Returns
Section titled “Returns”validation()
Section titled “validation()”Call Signature
Section titled “Call Signature”static validation( code, message, context?): EngineError;Defined in: packages/engine/src/errors/EngineError.ts:214
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
code | string |
message | string |
context? | Record<string, unknown> |
Returns
Section titled “Returns”Call Signature
Section titled “Call Signature”static validation(init): EngineError;Defined in: packages/engine/src/errors/EngineError.ts:215
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
init | EngineErrorInit |