Documentation ¶
Index ¶
- Constants
- Variables
- func ActionableErr(cfg interface{}, phase constants.Phase, err error) *proto.ActionableErr
- func ActionableErrV2(cfg interface{}, phase constants.Phase, err error) *protoV2.ActionableErr
- func AddPhaseProblems(phase constants.Phase, problems []Problem)
- func IsSkaffoldErr(err error) bool
- func ShowAIError(cfg interface{}, err error) error
- type ErrDef
- type Error
- type Problem
Constants ¶
View Source
const (
// PushImageErr is the error prepended.
PushImageErr = "could not push image"
)
Variables ¶
View Source
var (
ReportIssueSuggestion = func(interface{}) []*proto.Suggestion {
return []*proto.Suggestion{{
SuggestionCode: proto.SuggestionCode_OPEN_ISSUE,
Action: reportIssueText,
}}
}
)
Functions ¶
func ActionableErr ¶
ActionableErr returns an actionable error message with suggestions
func ActionableErrV2 ¶ added in v1.22.0
func ActionableErrV2(cfg interface{}, phase constants.Phase, err error) *protoV2.ActionableErr
ActionableErrV2 returns an actionable error message with suggestions
func AddPhaseProblems ¶ added in v1.22.0
func IsSkaffoldErr ¶
func ShowAIError ¶
Types ¶
type ErrDef ¶
type ErrDef struct {
// contains filtered or unexported fields
}
func NewErrorWithStatusCode ¶
func NewErrorWithStatusCode(ae proto.ActionableErr) ErrDef
NewError creates an actionable error message.
func (ErrDef) StatusCode ¶
func (e ErrDef) StatusCode() proto.StatusCode
func (ErrDef) Suggestions ¶
func (e ErrDef) Suggestions() []*proto.Suggestion
type Problem ¶ added in v1.22.0
type Problem struct { Regexp *regexp.Regexp Description func(error) string ErrCode proto.StatusCode Suggestion func(cfg interface{}) []*proto.Suggestion Err error }
Problem defines a problem which can list suggestions and error codes evaluated when showing Actionable error messages
func NewProblem ¶ added in v1.22.0
Click to show internal directories.
Click to hide internal directories.