Documentation
¶
Overview ¶
Package jsonpatch declares the error codes and the sentinels of the JSON-difference package (RFC 6902 operations, not a codec), internal/service/data/codec/jsonpatch — range 0.3.90.* (ADR 0143 service/data/codec/jsonpatch block).
The codes live in the core at the path that mirrors the package emitting them (ADR 0160 §2) and keep the values they were allocated with: the LL byte 3 records the layer that allocated the range, not the directory that declares it today (ADR 0160 §3). Nothing here encodes or decodes — the mechanism, and the constructors that attach a failure's detail, stay in the service package.
Package jsonpatch — the sentinel *errs.Error values, one per code. Each Reason derives from its var name or from its Code constant (ADR 0020); the Public and Private texts are the ones the service package always emitted, so moving the declaration changed no rendering.
No Public and no Private below carries a byte of either document: a document compared is routinely a record holding personal data, and an error is where input classically leaks back out.
Index ¶
Constants ¶
const CodeNotJSON errs.Code = 0x00_03_5A_01 // 0.3.90.1
CodeNotJSON identifies a document to compare that is not exactly one JSON value, read strictly: a syntax error, a truncation, trailing data, a duplicated member name, invalid UTF-8, or nesting past the reader's bound.
Variables ¶
var NotJSON = errs.Define(CodeNotJSON, "NOT_JSON", "A document to compare is not a JSON value", "service/data/codec/jsonpatch: a document is not exactly one well-formed JSON value; the fields name the document and the offset, never its content", errs.WithHTTPStatus(httpBadRequest), errs.WithExitCode(exitDataErr))
NotJSON refuses a document that is not exactly one JSON value. The fields name which document — "from" or "to" — and the byte offset where reading stopped, never what the document held.
Functions ¶
This section is empty.
Types ¶
This section is empty.