errors

package
v2.12.0 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 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

func ActionableErrV2(cfg interface{}, phase constants.Phase, err error) *protoV2.ActionableErr

ActionableErrV2 returns an actionable error message with suggestions

func AddPhaseProblems

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

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

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

func NewProblem(d descriptionFunc, sc proto.StatusCode, s suggestionFunc, err error) Problem

func (Problem) AIError

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

func (Problem) Error

func (p Problem) Error() string

type ProblemCatalog

type ProblemCatalog struct {
	// contains filtered or unexported fields
}

func NewProblemCatalog

func NewProblemCatalog() ProblemCatalog

func (ProblemCatalog) AddPhaseProblems

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