errors

package
v3.30.0 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2023 License: Apache-2.0, Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package errors wraps pkg/errors and includes some custom features such as error codes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func As

func As(err error, target interface{}) bool

func Cause

func Cause(err error) error

func Errorf

func Errorf(format string, args ...interface{}) error

func Is

func Is(err error, target Code) bool

Is is a fork of the Is() method from `pkg/errors` which takes as its target an error Code instead of an error.

func New

func New(code Code, message string) error

func Unwrap

func Unwrap(err error) error

func WithMessage

func WithMessage(err error, message string) error

func WithMessagef

func WithMessagef(err error, format string, args ...interface{}) error

func WithStack

func WithStack(err error) error

func Wrap

func Wrap(err error, message string) error

func Wrapf

func Wrapf(err error, fmt string, args ...interface{}) error

Types

type Code

type Code string

Code is an error code which can be used to check against a given error. For example, see the Is() method.

const (
	ErrUncoded Code = "Uncoded"
)

Jump to

Keyboard shortcuts

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