Documentation
¶
Overview ¶
Package toml declares the error codes and the sentinels of the TOML codec, internal/service/data/codec/toml — range 0.3.5.* (ADR 0005 service/data/codec/toml 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 toml — 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 CodeTOMLDepthExceeded errs.Code = 0x00_03_05_04 // 0.3.5.4
CodeTOMLDepthExceeded identifies input refused for a depth bound: tables and arrays nested past maxDepth. Its reason is the family's DEPTH_EXCEEDED (#894).
const CodeTOMLMarshalFailed errs.Code = 0x00_03_05_01 // 0.3.5.1
CodeTOMLMarshalFailed identifies a Go value the encoder cannot write as TOML.
const CodeTOMLSizeExceeded errs.Code = 0x00_03_05_03 // 0.3.5.3
CodeTOMLSizeExceeded identifies input refused for a size bound: a document past maxDocumentBytes. Its reason is the family's SIZE_EXCEEDED (#894).
const CodeTOMLUnmarshalFailed errs.Code = 0x00_03_05_02 // 0.3.5.2
CodeTOMLUnmarshalFailed identifies a document the decoder cannot read, or a value its target cannot hold.
Variables ¶
var ( // MarshalFailed reports a Go value TOML cannot represent: not a map or a // struct at the root, a nil interface, a channel, a function or a complex // number, an unsigned integer above the largest int64, a string that is // not UTF-8, a cycle — or a writer or a MarshalText method that failed. MarshalFailed = errs.Static(CodeTOMLMarshalFailed, "MARSHAL_FAILED", "TOML encoding failed", "service/data/codec/toml: the value has no TOML representation; the problem and type fields say why", 0, 0) // UnmarshalFailed reports a document that is not TOML, a document past // the size or nesting bound, or a value its target cannot hold. UnmarshalFailed = errs.Static(CodeTOMLUnmarshalFailed, "UNMARSHAL_FAILED", "TOML decoding failed", "service/data/codec/toml: the document is not valid TOML, or a value does not fit the target; the problem, line and column fields locate it", 0, 0) // SizeExceeded is the refusal of input past a size bound: a document past maxDocumentBytes. SizeExceeded = errs.Static(CodeTOMLSizeExceeded, "SIZE_EXCEEDED", "TOML input exceeds a size limit", "service/data/codec/toml: the input exceeds a size bound", 0, 0) // DepthExceeded is the refusal of input past a depth bound: tables and arrays nested past maxDepth. DepthExceeded = errs.Static(CodeTOMLDepthExceeded, "DEPTH_EXCEEDED", "TOML input nests too deeply", "service/data/codec/toml: the input exceeds a depth bound", 0, 0) )
Functions ¶
This section is empty.
Types ¶
This section is empty.