errors

package
v1.39.18 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

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 AddPhaseProblems(phase constants.Phase, problems []Problem)

func IsSkaffoldErr

func IsSkaffoldErr(err error) bool

func ShowAIError

func ShowAIError(cfg interface{}, err error) error

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) Error

func (e *ErrDef) Error() string

func (*ErrDef) StatusCode

func (e *ErrDef) StatusCode() proto.StatusCode

func (*ErrDef) Suggestions

func (e *ErrDef) Suggestions() []*proto.Suggestion

func (*ErrDef) Unwrap

func (e *ErrDef) Unwrap() error

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

func (Problem) AIError added in v1.22.0

func (p Problem) AIError(i interface{}, err error) error

func (Problem) Error added in v1.22.0

func (p Problem) Error() string

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)

Jump to

Keyboard shortcuts

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