errors

package
v1.22.0 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2023 License: MIT Imports: 3 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSet

func NewSet(e ...error) error

Create a set of errors. Only non-nil parameters are included. If only one non-nil parameter is provided it is simply returned and a set is not actually created.

func Stacktrace

func Stacktrace(err error) error

Stacktrace captures the current stack (excluding itself) and wraps the provided error with it.

Types

type Error

type Error struct {
	Message string      `json:"message"`
	Detail  interface{} `json:"detail,omitempty"`
	Cause   error       `json:"-"`
}

func Errorf

func Errorf(f string, a ...interface{}) *Error

func Wrap

func Wrap(err error, msg string) *Error

func Wrapf

func Wrapf(err error, f string, a ...interface{}) *Error

func (Error) Error

func (e Error) Error() string

func (*Error) SetCause

func (e *Error) SetCause(c error) *Error

func (*Error) SetDetail

func (e *Error) SetDetail(d interface{}) *Error

func (Error) Unwrap

func (e Error) Unwrap() error

type Set

type Set []error

func (Set) Error

func (e Set) Error() string

Conform to error. This method simply concatenates the result of Error() for all the elements of the set and returns the result.

Jump to

Keyboard shortcuts

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