Documentation
¶
Overview ¶
Package ndjson declares the error codes and the sentinels of the NDJSON codec, internal/service/data/codec/ndjson — range 0.3.11.* (ADR 0005 service/data/codec/ndjson 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 ndjson — 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.
Index ¶
Constants ¶
const CodeNDJSONMarshalFailed errs.Code = 0x00_03_0B_01 // 0.3.11.1
CodeNDJSONMarshalFailed identifies a failure inside encoding/json.Marshal when encoding a single NDJSON record.
const CodeNDJSONUnmarshalFailed errs.Code = 0x00_03_0B_02 // 0.3.11.2
CodeNDJSONUnmarshalFailed identifies a failure inside encoding/json.Unmarshal when decoding a single NDJSON record.
const CodeNDJSONValueInvalid errs.Code = 0x00_03_0B_03 // 0.3.11.3
CodeNDJSONValueInvalid identifies a Marshal / Unmarshal call whose target is not a slice (NDJSON models a stream of records).
Variables ¶
var ( // MarshalFailed wraps a failure from encoding/json.Marshal on a single record. MarshalFailed = errs.Define(CodeNDJSONMarshalFailed, "MARSHAL_FAILED", "NDJSON encoding failed", "service/data/codec/ndjson: encoding/json.Marshal returned an error on a record") // UnmarshalFailed wraps a failure from encoding/json.Unmarshal on a single record. UnmarshalFailed = errs.Define(CodeNDJSONUnmarshalFailed, "UNMARSHAL_FAILED", "NDJSON decoding failed", "service/data/codec/ndjson: encoding/json.Unmarshal returned an error on a record") // ValueInvalid fires when the caller does not pass a slice target. ValueInvalid = errs.Define(CodeNDJSONValueInvalid, "VALUE_INVALID", "NDJSON codec requires a slice target", "service/data/codec/ndjson: Marshal/Unmarshal called with a non-slice argument") )
Functions ¶
This section is empty.
Types ¶
This section is empty.