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
- func V2fromV1(ae proto.ActionableErr) protoV2.ActionableErr
- type ErrDef
- type Error
- type Problem
- type ProblemCatalog
Constants ¶
View Source
const (
// PushImageErr is the error prepended.
PushImageErr = "could not push image"
)
Variables ¶
View Source
var (
// GetProblemCatalogCopy get a copies of the current problem catalog.
GetProblemCatalogCopy = getProblemCatalogCopy
)
View Source
var ( ReportIssueSuggestion = func(interface{}) []*proto.Suggestion { return []*proto.Suggestion{{ SuggestionCode: proto.SuggestionCode_OPEN_ISSUE, Action: reportIssueText, }} } )
Functions ¶
func ActionableErr ¶
func ActionableErr(cfg interface{}, phase constants.Phase, err error) *proto.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 ¶
func V2fromV1 ¶ added in v1.26.0
func V2fromV1(ae proto.ActionableErr) protoV2.ActionableErr
Types ¶
type ErrDef ¶
type ErrDef struct {
// contains filtered or unexported fields
}
func NewError ¶
func NewError(err error, ae proto.ActionableErr) ErrDef
NewError creates an actionable error message preserving the actual error.
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 Error ¶
type Error interface {
Error() string
StatusCode() proto.StatusCode
Suggestions() []*proto.Suggestion
Unwrap() error
}
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
func NewProblem(d descriptionFunc, sc proto.StatusCode, s suggestionFunc, err error) Problem
type ProblemCatalog ¶ added in v1.24.0
type ProblemCatalog struct {
// contains filtered or unexported fields
}
func NewProblemCatalog ¶ added in v1.24.0
func NewProblemCatalog() ProblemCatalog
func (ProblemCatalog) AddPhaseProblems ¶ added in v1.24.0
func (p ProblemCatalog) AddPhaseProblems(phase constants.Phase, problems []Problem)
Click to show internal directories.
Click to hide internal directories.