Documentation
¶
Overview ¶
Package multipart declares the error codes and the sentinels of the multipart/form-data codec, internal/service/data/codec/multipart — range 0.3.41.* (ADR 0005 service/data/codec/multipart 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 multipart — 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 CodeMultipartBoundaryInvalid errs.Code = 0x00_03_29_04 // 0.3.41.4
CodeMultipartBoundaryInvalid identifies a boundary the codec cannot use: caller-supplied but outside the RFC 2046 charset / length, or absent from a body whose first delimiter line could not be recovered.
const CodeMultipartLimitExceeded errs.Code = 0x00_03_29_05 // 0.3.41.5
CodeMultipartLimitExceeded identifies a payload that crossed one of the configured bounds — per-part bytes, part count, or aggregate bytes.
const CodeMultipartLimitsInvalid errs.Code = 0x00_03_29_06 // 0.3.41.6
CodeMultipartLimitsInvalid identifies a Limits value the codec refuses to interpret: a negative bound is neither a bound nor a documented default, and guessing which one the caller meant is exactly what ADR 0031 forbids.
const CodeMultipartMarshalFailed errs.Code = 0x00_03_29_01 // 0.3.41.1
CodeMultipartMarshalFailed identifies a failure while writing a multipart/form-data body — a part header, a part body, or the JSON intermediate produced for the JSON-mediated single-part shape.
const CodeMultipartUnmarshalFailed errs.Code = 0x00_03_29_02 // 0.3.41.2
CodeMultipartUnmarshalFailed identifies a failure while parsing a multipart/form-data body: a malformed part header, a part with no form-data name, a missing closing delimiter, or a JSON-mediated part whose payload is not valid JSON.
const CodeMultipartValueInvalid errs.Code = 0x00_03_29_03 // 0.3.41.3
CodeMultipartValueInvalid identifies a Marshal / Unmarshal / Encode call whose argument shape the codec cannot honour — an Unmarshal target that is not a non-nil pointer, a Part carrying no field name, or a Part whose Name, FileName or ContentType carries a CR, LF or NUL (field "field" names which).
Variables ¶
var ( // MarshalFailed wraps a failure raised while writing a part. MarshalFailed = errs.Static(CodeMultipartMarshalFailed, "MARSHAL_FAILED", "multipart encoding failed", "service/data/codec/multipart: mime/multipart returned an error while writing a part", 0, 0) // UnmarshalFailed wraps a failure raised while parsing a body. UnmarshalFailed = errs.Static(CodeMultipartUnmarshalFailed, "UNMARSHAL_FAILED", "multipart decoding failed", "service/data/codec/multipart: mime/multipart returned an error while reading a part", 0, 0) // ValueInvalid fires when the caller's argument shape cannot be honoured. ValueInvalid = errs.Static(CodeMultipartValueInvalid, "VALUE_INVALID", "multipart codec rejected the value shape", "service/data/codec/multipart: Marshal/Unmarshal called with an unusable argument", 0, 0) // BoundaryInvalid fires when no usable RFC 2046 boundary is available. BoundaryInvalid = errs.Static(CodeMultipartBoundaryInvalid, "BOUNDARY_INVALID", "multipart boundary is missing or invalid", "service/data/codec/multipart: boundary absent from the body or outside the RFC 2046 charset", 0, 0) // LimitExceeded fires when a payload crosses one of the configured bounds. LimitExceeded = errs.Static(CodeMultipartLimitExceeded, "LIMIT_EXCEEDED", "multipart payload exceeds a configured limit", "service/data/codec/multipart: part size, part count or aggregate size crossed its bound", 0, 0) // LimitsInvalid fires when a Limits value carries a negative bound. LimitsInvalid = errs.Static(CodeMultipartLimitsInvalid, "LIMITS_INVALID", "multipart limits are not usable", "service/data/codec/multipart: a negative bound is neither a limit nor a request for the default", 0, 0) )
Functions ¶
This section is empty.
Types ¶
This section is empty.