xerrors

package module
v0.0.0-...-ec7525c Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2019 License: MIT Imports: 8 Imported by: 41

README

errors

dynamicgo errors enhance library

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PrintStack = true

PrintStack print stack flag

Functions

func As

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

As check if the err is target err

func Errorf

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

Errorf .

func Is

func Is(err, target error) (ok bool)

Is check if the err is target err

func New

func New(message string) error

New .

func RegisterFacade

func RegisterFacade(name string, facade ErrorFacade)

RegisterFacade .

func Wrap

func Wrap(err error, message string) error

Wrap .

func Wrapf

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

Wrapf .

Types

type Error

type Error interface {
	error              // mixin standard error interface
	CallStack() string // get call stack
	Cause() error      // error chain
}

Error .

func NewStackError

func NewStackError(skip int, err, prev error) Error

NewStackError create new error with skip

type ErrorFacade

type ErrorFacade interface {
	Is(err, target error) bool
	As(err error, target interface{}) bool
}

ErrorFacade .

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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