errors#

Classes#

InvalidManifestError#

Defined in: errors.ts:126

Thrown when a manifest fails the schema or an invariant at save time.

Extends#

  • Error

Constructors#

Constructor#

new InvalidManifestError(problems): InvalidManifestError

Defined in: errors.ts:129

Parameters#
problems#

readonly Problem[]

Returns#

InvalidManifestError

Overrides#

Error.constructor

Properties#

problems#

readonly problems: readonly Problem[]

Defined in: errors.ts:127


JournalMismatchError#

Defined in: errors.ts:147

Thrown when replaying a workspace’s journal does not reproduce the view the workspace holds: entry is the index of the first journal entry after which the replayed view differs from what the snapshot implies, path the first differing location in the view (["name"], ["graphical"] or ["blocks", <id>, ...]).

Extends#

  • Error

Constructors#

Constructor#

new JournalMismatchError(entry, path): JournalMismatchError

Defined in: errors.ts:151

Parameters#
entry#

number

path#

readonly PathSegment[]

Returns#

JournalMismatchError

Overrides#

Error.constructor

Properties#

entry#

readonly entry: number

Defined in: errors.ts:148

path#

readonly path: readonly PathSegment[]

Defined in: errors.ts:149

Interfaces#

LoadError#

Defined in: errors.ts:94

Why manifest or workspace text was refused: every problem found.

Properties#

problems#

readonly problems: readonly Problem[]

Defined in: errors.ts:95


Problem#

Defined in: errors.ts:84

One problem: a code from ErrorCode, a description, and the path of the offending value.

For a load, the path points into the text read: into the manifest, or into the workspace file (["blocks", <id>, "manifest", ...]). For a command, it starts with the address key (addressKey) of the target at fault, followed by the property at fault ([<address key>, "length"]) or, for a value add puts in, by its kind and the location in the value ([<address key of into>, "timeline", "id"]). A problem of the manifest the command would leave lies there instead: at the block’s ID, "manifest" and the location in that manifest ([<block id>, "manifest", "timelines", 0, ...]). Only a malformed command, which has no target, names the malformed member of the command itself.

Properties#

code#

readonly code: ErrorCode

Defined in: errors.ts:85

message#

readonly message: string

Defined in: errors.ts:86

path#

readonly path: readonly PathSegment[]

Defined in: errors.ts:87

Type Aliases#

CommandError#

CommandError = Problem

Defined in: errors.ts:91

Why a command was refused.


ErrorCode#

ErrorCode = typeof ErrorCode[keyof typeof ErrorCode]

Defined in: errors.ts:9

One problem code: a value of the ErrorCode constants.

Variables#

ErrorCode#

const ErrorCode: object

Defined in: errors.ts:9

Every problem code, as stable string constants.

Type Declaration#

arrangementConflict#

readonly arrangementConflict: "arrangement_conflict" = "arrangement_conflict"

childExceedsParent#

readonly childExceedsParent: "child_exceeds_parent" = "child_exceeds_parent"

computedFlowMap#

readonly computedFlowMap: "computed_flow_map" = "computed_flow_map"

cycle#

readonly cycle: "cycle" = "cycle"

duplicateId#

readonly duplicateId: "duplicate_id" = "duplicate_id"

duplicateIndex#

readonly duplicateIndex: "duplicate_index" = "duplicate_index"

elisionExceedsLength#

readonly elisionExceedsLength: "elision_exceeds_length" = "elision_exceeds_length"

elisionStretch#

readonly elisionStretch: "elision_stretch" = "elision_stretch"

elisionTimeline#

readonly elisionTimeline: "elision_timeline" = "elision_timeline"

idNotSettable#

readonly idNotSettable: "id_not_settable" = "id_not_settable"

invalidAddress#

readonly invalidAddress: "invalid_address" = "invalid_address"

invalidBlockId#

readonly invalidBlockId: "invalid_block_id" = "invalid_block_id"

invalidCommand#

readonly invalidCommand: "invalid_command" = "invalid_command"

invalidCoordinate#

readonly invalidCoordinate: "invalid_coordinate" = "invalid_coordinate"

invalidIndex#

readonly invalidIndex: "invalid_index" = "invalid_index"

invalidJson#

readonly invalidJson: "invalid_json" = "invalid_json"

invalidOrder#

readonly invalidOrder: "invalid_order" = "invalid_order"

invalidValue#

readonly invalidValue: "invalid_value" = "invalid_value"

invalidYaml#

readonly invalidYaml: "invalid_yaml" = "invalid_yaml"

journalMismatch#

readonly journalMismatch: "journal_mismatch" = "journal_mismatch"

keyMismatch#

readonly keyMismatch: "key_mismatch" = "key_mismatch"

lengthBelowContent#

readonly lengthBelowContent: "length_below_content" = "length_below_content"

locked#

readonly locked: "locked" = "locked"

missingMember#

readonly missingMember: "missing_member" = "missing_member"

negativeChildOffset#

readonly negativeChildOffset: "negative_child_offset" = "negative_child_offset"

nestedMember#

readonly nestedMember: "nested_member" = "nested_member"

noEditor#

readonly noEditor: "no_editor" = "no_editor"

nonFiniteNumber#

readonly nonFiniteNumber: "non_finite_number" = "non_finite_number"

nonPositiveNumber#

readonly nonPositiveNumber: "non_positive_number" = "non_positive_number"

notAnItem#

readonly notAnItem: "not_an_item" = "not_an_item"

notInside#

readonly notInside: "not_inside" = "not_inside"

notRemovable#

readonly notRemovable: "not_removable" = "not_removable"

parentCycle#

readonly parentCycle: "parent_cycle" = "parent_cycle"

regionEndBeforeStart#

readonly regionEndBeforeStart: "region_end_before_start" = "region_end_before_start"

schemaViolation#

readonly schemaViolation: "schema_violation" = "schema_violation"

segmentEndFixed#

readonly segmentEndFixed: "segment_end_fixed" = "segment_end_fixed"

segmentNeverLocked#

readonly segmentNeverLocked: "segment_never_locked" = "segment_never_locked"

segmentNotRemovable#

readonly segmentNotRemovable: "segment_not_removable" = "segment_not_removable"

segmentStructure#

readonly segmentStructure: "segment_structure" = "segment_structure"

sessionReferencedTwice#

readonly sessionReferencedTwice: "session_referenced_twice" = "session_referenced_twice"

sideEffect#

readonly sideEffect: "side_effect" = "side_effect"

timestampExceedsLength#

readonly timestampExceedsLength: "timestamp_exceeds_length" = "timestamp_exceeds_length"

unitMismatch#

readonly unitMismatch: "unit_mismatch" = "unit_mismatch"

unknownMember#

readonly unknownMember: "unknown_member" = "unknown_member"

unknownParent#

readonly unknownParent: "unknown_parent" = "unknown_parent"

unknownPlace#

readonly unknownPlace: "unknown_place" = "unknown_place"

unknownProperty#

readonly unknownProperty: "unknown_property" = "unknown_property"

unknownSession#

readonly unknownSession: "unknown_session" = "unknown_session"

unknownTarget#

readonly unknownTarget: "unknown_target" = "unknown_target"

unlockingNotSupported#

readonly unlockingNotSupported: "unlocking_not_supported" = "unlocking_not_supported"

unreferencedSession#

readonly unreferencedSession: "unreferenced_session" = "unreferenced_session"

unsupportedFormat#

readonly unsupportedFormat: "unsupported_format" = "unsupported_format"

unsupportedVersion#

readonly unsupportedVersion: "unsupported_version" = "unsupported_version"

wrongTargetKind#

readonly wrongTargetKind: "wrong_target_kind" = "wrong_target_kind"

Functions#

assertNever()#

assertNever(value): never

Defined in: errors.ts:168

The end of a closed switch over the kinds of a union: once every kind has its case, value has the type never, so a kind added to the union later fails to compile until the switch takes it. Reached at run time only through a value its type does not admit; it then throws, naming the value’s kind where it has one.

Parameters#

value#

never

Returns#

never


isCommandError()#

isCommandError(value): value is Problem

Defined in: errors.ts:104

Whether a result of apply, dispatch or parseCommand is a refusal.

Parameters#

value#

unknown

Returns#

value is Problem


isLoadError()#

isLoadError(value): value is LoadError

Defined in: errors.ts:116

Whether a manifest or workspace load result is a refusal.

Parameters#

value#

unknown

Returns#

value is LoadError


problem()#

problem(code, message, path): Problem

Defined in: errors.ts:99

A problem with the given code, description and path.

Parameters#

code#

ErrorCode

message#

string

path#

readonly PathSegment[]

Returns#

Problem