Documentation
¶
Index ¶
Constants ¶
View Source
const ( Red = "\033[31m" Yellow = "\033[33m" Cyan = "\033[36m" White = "\033[37m" Gray = "\033[90m" Reset = "\033[0m" Bold = "\033[1m" )
ANSI color codes for terminal output
Variables ¶
View Source
var ( // ErrPropertyResolution is the canonical errorx property key for attaching // human-readable remediation hints to errors. Aliased from pkg/models so that // errors set by any package (workflow steps, config loaders, etc.) are found // by findResolution regardless of which package attached the property. ErrPropertyResolution = models.ErrPropertyResolution ErrNamespace = errorx.NewNamespace("doctor") NotFoundError = ErrNamespace.NewType("not_found", errorx.NotFound()) )
View Source
var VerboseLevel int
VerboseLevel controls error output detail. When >= 1 (-V), CheckErr displays the full stacktrace and profiling data. Otherwise a compact human-friendly error panel is shown and details are written only to the log file.
Functions ¶
func CheckErr ¶
CheckErr prints diagnosis and exit with error code 1 Optional instructions can be provided to give additional context to the user
func CheckReportErr ¶
CheckReportErr checks an automa.Report for errors and runs diagnosis if any are found
func GetInstructionsFromReport ¶
GetInstructionsFromReport recursively searches for instructions in report metadata. Returns the first non-empty instructions found in the report tree, or an empty string if none exist.
Types ¶
type ErrorDiagnosis ¶
type ErrorDiagnosis struct {
Error error `yaml:"error" json:"error"`
Message string `yaml:"message" json:"message"`
Cause string `yaml:"cause" json:"cause"`
ErrorType string `yaml:"errorType" json:"errorType"`
TraceId string `yaml:"traceId" json:"traceId"`
Commit string `yaml:"commit" json:"commit"`
Version string `yaml:"version" json:"version"`
GoVersion string `yaml:"goVersion" json:"goVersion"`
Pid int `yaml:"pid" json:"pid"`
StackTrace []string `yaml:"stackTrace" json:"stackTrace"`
Code int `yaml:"code" json:"code"`
Logfile string `yaml:"log" json:"log"`
ProfilingSnapshots map[string]string `yaml:"ProfilingSnapshots" json:"profilingSnapshots"`
Resolution []string `yaml:"steps" json:"steps"`
WhyFloor string `yaml:"whyFloor" json:"whyFloor"`
}
Click to show internal directories.
Click to hide internal directories.