Documentation
¶
Overview ¶
Package errexplain provides structured error explanation and pattern matching for scafctl errors. It converts raw error messages into categorized explanations with root cause analysis and actionable suggestions.
This is a shared domain package used by CLI, MCP, and future API consumers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Explanation ¶
type Explanation struct {
Category string `json:"category" yaml:"category" doc:"Error classification category" maxLength:"64" example:"resolver_execution"`
Summary string `` /* 145-byte string literal not displayed */
RootCause string `json:"rootCause" yaml:"rootCause" doc:"Detailed root cause analysis" maxLength:"2048" example:"connection refused"`
Suggestions []string `json:"suggestions" yaml:"suggestions" doc:"Actionable steps to fix the error" maxItems:"20"`
RelatedDocs []string `json:"relatedDocs,omitempty" yaml:"relatedDocs,omitempty" doc:"Related documentation links" maxItems:"10"`
Example string `` /* 146-byte string literal not displayed */
}
Explanation is the structured response for an error explanation.
func Explain ¶
func Explain(errText string) *Explanation
Explain parses an error message and returns a structured explanation if a known pattern matches. If no pattern matches, it returns a generic explanation.
Click to show internal directories.
Click to hide internal directories.