errors

package
v0.62.0 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const UserErrorLabel = "[User error] "

Variables

This section is empty.

Functions

func GetErrorMessage added in v0.57.0

func GetErrorMessage(err error) string

GetErrorMessage returns the error message with the user error label if it is of type user error

func LabelUserError

func LabelUserError(messageFormat string, messageA []interface{}) string

LabelUserError labels the failure RunStatus message if any of its error messages has been wrapped as an UserError. It indicates that the user is responsible for an error. See github.com/tektoncd/pipeline/blob/main/docs/pipelineruns.md#marking-off-user-errors for more details.

func WrapUserError

func WrapUserError(err error) error

WrapUserError wraps the original error with the user error label

Types

type UserError

type UserError struct {
	Reason   string
	Original error
}

func (*UserError) Error

func (e *UserError) Error() string

Error returns the original error message. This implements the error.Error interface.

func (*UserError) Unwrap

func (e *UserError) Unwrap() error

Unwrap returns the original error without the Reason annotation. This is intended to support usage of errors.Is and errors.As with Errors.

Jump to

Keyboard shortcuts

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