Documentation
¶
Overview ¶
Package errcode names goav's structured error vocabulary. Family is the stable application branch key; Code is a detailed diagnostic leaf that may grow within a family before v1. Match errors with errors.As(err, *goav.BuildError), switch on Family first, and use Code when a caller needs a specific diagnostic leaf. Rendered text may improve over time. See docs/ERRORS.md for the contract and matching recipes.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Code ¶
type Code string
Code identifies a detailed BuildError refusal leaf. Families are the stable application-level matching surface; codes are the detailed diagnostic surface.
Code is an open string, not a closed enum: external components emit their own vendor-prefixed codes through the same BuildError shape, and they flow through matching and rendering unchanged. The catalog below is goav's own vocabulary, not the universe of valid errcode.
const ( // TapInvalid fires when a tap name is empty. TapInvalid Code = "tap_invalid" // TapDomainMismatch fires when a typed tap's domain (frame/packet) // does not match the chain point it is declared on. TapDomainMismatch Code = "tap_domain_mismatch" )
Tap errcode.
const ( // JoinNameInvalid fires when a custom join (goav.Join) declares an // unusable name: empty, not snake-safe ([a-z][a-z0-9_]*), reserved by a // built-in kind (mix, composite, select), or colliding with another join // node in the same join tree. JoinNameInvalid Code = "join_name_invalid" // JoinStageInvalid fires when a custom join's convergence stage is nil // or reports a Name() different from the join's name. JoinStageInvalid Code = "join_stage_invalid" )
Join codes. Built-in and custom join profile refusals derive per-kind codes as <kind>_<family> through goav's joinErrorCode helper; custom joins use the same families under their own snake-safe names. The explicit catalog here is limited to constructor/name validation that does not derive from a profile.
const ( // RuntimeMissing fires when a job reaches Build with no runtime // configured. RuntimeMissing Code = "runtime_missing" // RecipeGraphUnsupported fires when the recipe intent matches no // supported graph plan. RecipeGraphUnsupported Code = "recipe_graph_unsupported" )
Job and compiler errcode.
const ( // StreamRuleInvalid fires when an OnStream rule is malformed (no // matcher, no branch, or an unusable discovered stream). StreamRuleInvalid Code = "stream_rule_invalid" )
Stream rule codes (OnStream grammar).
type Family ¶
type Family string
Family identifies the stable high-level BuildError class. Code is the detailed diagnostic leaf during the typed-error migration; Family is the field callers should switch on before inspecting a specific catalog code.
const ( // FamilyInput groups input, source, probing, and source-shape refusals. FamilyInput Family = "input" // FamilyStream groups stream selection and stream-chain ordering refusals. FamilyStream Family = "stream" // FamilyTransform groups explicit transform and transform adapter refusals. FamilyTransform Family = "transform" // FamilyShape groups shape requirement and automatic-conversion refusals. FamilyShape Family = "shape" // FamilyCodec groups codec adapter availability and capability refusals. FamilyCodec Family = "codec" // FamilyEncode groups encoder-stage and encoder-setting refusals. FamilyEncode Family = "encode" // FamilyDestination groups output, destination, muxer, and sink refusals. FamilyDestination Family = "destination" // FamilyBranch groups build-time branch grammar and composition refusals. FamilyBranch Family = "branch" // FamilyBuffer groups branch and graph buffer safety refusals. FamilyBuffer Family = "buffer" // FamilyTap groups tap declaration and tap-domain refusals. FamilyTap Family = "tap" // FamilyJoin groups Mix, Composite, Select, and custom Join refusals. FamilyJoin Family = "join" // FamilyRuntimeBranch groups task.Attach and rebranch refusals. FamilyRuntimeBranch Family = "runtime_branch" // FamilyStreamRule groups OnStream rule grammar refusals. FamilyStreamRule Family = "stream_rule" // FamilyCompiler groups compiler and internal graph-plan refusals. FamilyCompiler Family = "compiler" // FamilyExternal groups vendor-prefixed or otherwise uncataloged codes. FamilyExternal Family = "external" )
func FamilyForCode ¶
FamilyForCode returns the stable family for a goav error code. It also recognizes goav's non-failing plan diagnostic strings for report grouping. Unknown vendor-prefixed codes fall back to FamilyExternal. Custom join codes generated by goav.Join use the same suffix families as built-in joins.