Whether value carries the moduleName, _tag, code, and message fields every Knotkit error
exposes. Structural, so it recognises an error from another realm or a duplicate bundle copy.
Restore a binary snapshot set after validating all counts, histories,
snapshot identities, codec results, and duplicate values in staging data.
@throws ― {SnapshotSetInvalidInputError} With MISSING_ELEMENT_CODEC when
options.codec is absent: supplying the codec is a caller contract, not a
property of the bytes.
@throws ― {SnapshotSetParseError} For malformed bytes, unsupported versions,
invalid histories, duplicate values, or decode-budget violations.
Restore a binary snapshot set after validating all counts, histories,
snapshot identities, codec results, and duplicate values in staging data.
@throws ― {SnapshotSetInvalidInputError} With MISSING_ELEMENT_CODEC when
options.codec is absent: supplying the codec is a caller contract, not a
property of the bytes.
@throws ― {SnapshotSetParseError} For malformed bytes, unsupported versions,
invalid histories, duplicate values, or decode-budget violations.
Whether value carries the moduleName, _tag, code, and message fields every Knotkit error
exposes. Structural, so it recognises an error from another realm or a duplicate bundle copy.
Use knotkit/errors for this task. If Knotkit is missing, follow https://knotkit.jkomyno.dev/getting-started.md#install-from-source. Import from 'knotkit/errors'.
Exports:
- `safeString` → `string`: Format an unknown value for a message without letting a hostile toString or Symbol.toPrimitive replace the caller's error.
Use something else when:
- throw or catch errors in an application that depends on no Knotkit package → the platform Error class or a project-local subclass with its own codes
- throw a concrete error from your own Knotkit package → extend InvalidInputError or ParseError with a package-scoped subclass and a closed code list
- carry an error's package name, category, and code across a process or JSON boundary → an explicit error envelope marshalled by the caller, because no class here serializes
- validate caller input or decode a payload for a structure that is not a Knotkit package → a schema validator such as Zod, or a project-local error class
Full page: https://knotkit.jkomyno.dev/modules/errors.md
Types: node_modules/knotkit/errors/ and https://knotkit.jkomyno.dev/reference/knotkit/errors/