package promptkit import ( "errors" "fmt" ) // ErrNilBundle is returned by Build when given a nil PromptBundle. // // ErrNilBundle 在 Build 收到 nil PromptBundle 时返回. var ErrNilBundle = errors.New("promptkit: nil PromptBundle") // SectionRenderError wraps an error from a Section.Render call. // Layer is "base" or "conditional"; Section is the offending section's Name(). // // SectionRenderError 包装 Section.Render 调用的错误. // Layer 是 "base" 或 "conditional"; Section 是出错段的 Name(). type SectionRenderError struct { Layer string Section string Cause error } func (e *SectionRenderError) Error() string { return fmt.Sprintf("promptkit: section %q in layer %q render failed: %v", e.Section, e.Layer, e.Cause) } func (e *SectionRenderError) Unwrap() error { return e.Cause }