utils

package
v1.5.1-0...-f4f0154 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewErrorFormatFuncWithPrefix

func NewErrorFormatFuncWithPrefix(prefix string) multierror.ErrorFormatFunc

NewErrorFormatFuncWithPrefix creates a new multierror.ErrorFormatFunc which can be used as an ErrorFormat on multierror.Error instances. The error string is prefixed with <prefix>, all errors are concatenated at the end. This is similar to multierror.ListFormatFunc but does not use any escape sequences, which will look weird in the status of Kubernetes objects or controller logs.

Types

type WithExitCode

type WithExitCode struct {
	Code       int
	Underlying error
}

WithExitCode annotates an error with an exit code.

func (WithExitCode) Error

func (w WithExitCode) Error() string

Error implements error.

func (WithExitCode) ExitCode

func (w WithExitCode) ExitCode() int

ExitCode returns the exit code associated with this error.

func (WithExitCode) Unwrap

func (w WithExitCode) Unwrap() error

Unwrap returns the underlying error.

Jump to

Keyboard shortcuts

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