Skip to main content

Module errors

Module errors 

Source
Expand description

jacs-core error type.

CoreError is the protocol-layer error enum surfaced by every operation in jacs-core (sign, verify, envelope decrypt, agreement quorum, schema lookup, …). It is deliberately independent of jacs::JacsError so jacs-core can compile for wasm32-unknown-unknown without dragging in native-only crates. The native facade converts via From<CoreError> for jacs::JacsError (lives in jacs/src/error.rs).

§Serialization contract

Every CoreError serializes as

{ "code": "VariantName", "message": "human readable text", "details": { … } }

details is only present when the variant carries structured fields (e.g. AlgorithmMismatch { expected, actual }); single-String variants omit it. The shape is stable — jacs-wasm exposes it as JacsWasmError to browser callers, and the code discriminator is load-bearing for client-side error handling. See PRD §3.1.

Enums§

CoreError
Protocol-layer error.