kubernetesk8s.io/kubernetes/cmd/kubeadm/app/util/errors Index | Files

package errors

import "k8s.io/kubernetes/cmd/kubeadm/app/util/errors"

Package errors contains a local implementation of error wrapping with stack traces similar to https://github.com/pkg/errors. Note that this is a written from scratch, much simpler implementation and not a fork of pkg/errors.

Index

Functions

func As

func As(err error, target any) bool

As wraps the stdlib errors.As.

func Errorf

func Errorf(format string, args ...any) error

Errorf is calls the stdlib errors.Errorf and includes a stack trace.

func HandleError

func HandleError(err error)

HandleError is the default wrapper around handleError for handling errors that calls the exitWithCode function as a callback.

func Is

func Is(err, target error) bool

Is wraps the stdlib errors.Is.

func New

func New(message string) error

New calls the stdlib errors.New and includes a stack trace.

func StackTrace

func StackTrace(err error) string

StackTrace retrieves the stack trace of an error as a string.

func Unwrap

func Unwrap(err error) error

Unwrap unwraps an error using the stdlib method.

func WithMessage

func WithMessage(err error, message string) error

WithMessage includes formats an error with a message and includes stack trace.

func WithMessagef

func WithMessagef(err error, format string, args ...any) error

WithMessagef is the same as WithMessage but supports formatting and arguments.

func Wrap

func Wrap(err error, message string) error

Wrap wraps an error and includes stack.

func Wrapf

func Wrapf(err error, format string, args ...any) error

Wrapf is the same as Wrap but supports formatting and arguments.

Source Files

errors.go

Version
v1.34.0-alpha.3
Published
Jul 9, 2025
Platform
js/wasm
Imports
8 packages
Last checked
48 seconds ago

Tools for package owners.