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 ¶
- func As(err error, target any) bool
- func Errorf(format string, args ...any) error
- func HandleError(err error)
- func Is(err, target error) bool
- func New(message string) error
- func StackTrace(err error) string
- func Unwrap(err error) error
- func WithMessage(err error, message string) error
- func WithMessagef(err error, format string, args ...any) error
- func Wrap(err error, message string) error
- func Wrapf(err error, format string, args ...any) error
Functions ¶
func As ¶
As wraps the stdlib errors.As.
func Errorf ¶
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 ¶
Is wraps the stdlib errors.Is.
func New ¶
New calls the stdlib errors.New and includes a stack trace.
func StackTrace ¶
StackTrace retrieves the stack trace of an error as a string.
func Unwrap ¶
Unwrap unwraps an error using the stdlib method.
func WithMessage ¶
WithMessage includes formats an error with a message and includes stack trace.
func WithMessagef ¶
WithMessagef is the same as WithMessage but supports formatting and arguments.
func Wrap ¶
Wrap wraps an error and includes stack.
func Wrapf ¶
Wrapf is the same as Wrap but supports formatting and arguments.
Source Files ¶
errors.go
- Version
- v1.34.0-alpha.2
- Published
- Jun 25, 2025
- Platform
- js/wasm
- Imports
- 8 packages
- Last checked
- 15 seconds ago –
Tools for package owners.