errexplain

package
v0.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 30, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL