errors

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func As

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

func Detail

func Detail(err error) string

func Err

func Err(err error) error

func Is

func Is(err, target error) bool

func New

func New(msg string) error

func Unwrap

func Unwrap(err error) error

Types

type ErrorInfo

type ErrorInfo = Frame

func Info

func Info(err error, cmd ...interface{}) *ErrorInfo

func InfoEx

func InfoEx(calldepth int, err error, cmd ...interface{}) *ErrorInfo

func (*ErrorInfo) AppendErrorDetail

func (p *ErrorInfo) AppendErrorDetail(b []byte) []byte

func (*ErrorInfo) Detail

func (p *ErrorInfo) Detail(err error) *ErrorInfo

func (*ErrorInfo) ErrorDetail

func (p *ErrorInfo) ErrorDetail() string

func (*ErrorInfo) NestedObject

func (p *ErrorInfo) NestedObject() interface{}

func (*ErrorInfo) SummaryErr

func (p *ErrorInfo) SummaryErr() error

type Frame

type Frame struct {
	Err  error
	Pkg  string
	Func string
	Args []interface{}
	Code string
	File string
	Line int
}

自定义error

func NewFrame

func NewFrame(err error, code, file string, line int, pkg, fn string, args ...interface{}) *Frame

func (*Frame) Error

func (p *Frame) Error() string

func (*Frame) Format

func (p *Frame) Format(s fmt.State, verb rune)

func (*Frame) Unwrap

func (p *Frame) Unwrap() error

Jump to

Keyboard shortcuts

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