跳到主要内容

bolt/errors

bolt/errors

此内容目前仅提供英文版。

导入自 @norbital-ai/bolt/errors

@norbital-ai/bolt/errors: canonical tagged errors shared by guest bodies, pages and the test kit. The guest loads a family only when an operation needs it; these reexports retain the public class identities.

decl

ActConflict class

class ActConflict extends ActConflict_base {
    readonly message = "another write changed these records since they were read";
}

A write that lost a race: another write changed these records since they were read.

成员

名称类型说明
message"another write changed these records since they were read"
recordsSchema.$Array<Schema.Struct<{ readonly model: Schema.String; readonly id: Schema.String; }>>

源码: packages/bolt/src/decl/errors/act.ts:24

ActFailure type

type ActFailure = ActRefused | ActConflict | ActUnknown;

Every way ctx.act (and a kit caller's act) fails.

源码: packages/bolt/src/decl/errors/act.ts:38

ActRefused class

class ActRefused extends ActRefused_base {
}

A write refused: code is refused for an authored refusal, else the engine's code (forbidden, unique, …), with the field or rows it names and, for tenant code, the rule that refused. message is the text a person reads; an authored refusal also carries its catalogue key and placeholder values.

成员

名称类型说明
messagestring
codeSchema.String
key?Schema.optional<Schema.String>
values?Schema.optional<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number]>>>
rows?Schema.optional<Schema.$Array<Schema.Number>>
field?Schema.optional<Schema.String>
row?Schema.optional<Schema.Number>
rule?Schema.optional<Schema.String>
data?Schema.optional<Schema.Struct<{ readonly request_id: Schema.String; }>>

源码: packages/bolt/src/decl/errors/act.ts:11

errors

FacilityFailure class

class FacilityFailure extends FacilityFailure_base {
    /** Refuses invalid facility input without changing the shared tagged error identity. */
    static invalid(message: string): FacilityFailure;
}

A failed facility call: its kind, message, HTTP status and optional provider retry delay.

成员

名称类型说明
kindSchema.Literals<readonly ["upstream", "timeout", "rate_limited", "invalid", "too_large", "unsupported"]>
messagestring
status?Schema.optional<Schema.Number>
retry_after_ms?Schema.optional<Schema.Finite>

The provider's minimum delay before another attempt.

源码: packages/host-api/src/errors.ts:15

decl

ProtocolFailed class

class ProtocolFailed extends /*#__PURE__*/ ProtocolFailed_base {
}

An answer that is not the protocol's shape.

成员

名称类型说明
messagestring

源码: packages/bolt/src/decl/errors/browser.ts:13

ReadFailed class

class ReadFailed extends ReadFailed_base {
}

A page read the engine refused: its code and message.

成员

名称类型说明
codeSchema.String
messagestring

源码: packages/bolt/src/decl/errors/read.ts:5

Refusal class

class Refusal extends Refusal_base {
}

What ctx.refuse fails with: message is a catalogue key, values its placeholders, field names a field, and row the index of the offending row in the batch or list the body received. Bodies refuse through ctx.refuse, never by constructing it. The engine renders the key with the workspace catalogue.

成员

名称类型说明
messagestring
values?Schema.optional<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number]>>>
field?Schema.optional<Schema.String>
row?Schema.optional<Schema.Number>

源码: packages/bolt/src/decl/errors/refusal.ts:25

errors

Unavailable class

class Unavailable extends Unavailable_base {
    readonly message: string;
}

An optional facility with no provider bound, or an instance not paired: the facility and why.

成员

名称类型说明
messagestring
facilitySchema.String
reasonSchema.String

源码: packages/host-api/src/errors.ts:29