Documentation
¶
Overview ¶
Package catalog is the offline, embedded error-code knowledge base that powers `normatik explain` and the exit-code policy. It is generated from the backend sources (ErrorCode.java + PublicApiHints.java) by api/gen-catalog.mjs and embedded at build time, so the CLI explains every documented error without a network round-trip. `make verify` fails if the JSON drifts.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Closest ¶
Closest returns the catalogued name with the smallest edit distance (<=3), for "did you mean?" suggestions on an unknown code. Empty if nothing is close.
func ExitFor ¶
ExitFor is the single source of truth for mapping an (errorCode, httpStatus) pair to a stable exit code. Both Problem.ExitCode and any future caller route through here. For a known code with no wire status we fall back to the catalogued status (defends against a proxy rewriting the HTTP status).
Types ¶
type Entry ¶
type Entry struct {
Name string `json:"name"`
Status int `json:"status"`
Title string `json:"title"`
UserMessage string `json:"userMessage"`
HintKind string `json:"hintKind"`
ExitCode int `json:"exitCode"`
StaticHint string `json:"staticHint,omitempty"`
}
Entry is one documented ErrorCode. HintKind is STATIC|DYNAMIC|NO_HINT — matching the backend's three-set discipline (PublicApiHints).