kerrors

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2021 License: Apache-2.0 Imports: 3 Imported by: 88

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInternalException = &basicError{"internal exception"}
	ErrServiceDiscovery  = &basicError{"service discovery error"}
	ErrGetConnection     = &basicError{"get connection error"}
	ErrLoadbalance       = &basicError{"loadbalance error"}
	ErrNoMoreInstance    = &basicError{"no more instances to retry"}
	ErrRPCTimeout        = &basicError{"rpc timeout"}
	ErrACL               = &basicError{"request forbidden"}
	ErrCircuitBreak      = &basicError{"forbidden by circuitbreaker"}
	ErrRemoteOrNetwork   = &basicError{"remote or network error"}
	ErrOverlimit         = &basicError{"request over limit"}
	ErrPanic             = &basicError{"panic"}
	ErrBiz               = &basicError{"biz error"}

	ErrRetry = &basicError{"retry error"}
	// it happens when retry enabled and there is one call has finished
	ErrRPCFinish = &basicError{"rpc call finished"}
)

Basic error types

View Source
var (
	ErrNotSupported         = ErrInternalException.WithCause(errors.New("operation not supported"))
	ErrNoResolver           = ErrInternalException.WithCause(errors.New("no resolver available"))
	ErrNoDestService        = ErrInternalException.WithCause(errors.New("no dest service"))
	ErrNoDestAddress        = ErrInternalException.WithCause(errors.New("no dest address"))
	ErrNoConnection         = ErrInternalException.WithCause(errors.New("no connection available"))
	ErrConnOverLimit        = ErrOverlimit.WithCause(errors.New("to many connections"))
	ErrQPSOverLimit         = ErrOverlimit.WithCause(errors.New("request too frequent"))
	ErrNoIvkRequest         = ErrInternalException.WithCause(errors.New("invoker request not set"))
	ErrServiceCircuitBreak  = ErrCircuitBreak.WithCause(errors.New("service circuitbreak"))
	ErrInstanceCircuitBreak = ErrCircuitBreak.WithCause(errors.New("instance circuitbreak"))
)

More detailed error types

View Source
var TimeoutCheckFunc func(err error) bool

TimeoutCheckFunc is used to check whether the given err is a timeout error.

Functions

func IsKitexError

func IsKitexError(err error) bool

IsKitexError reports whether the given err is an error generated by kitex.

func IsTimeoutError

func IsTimeoutError(err error) bool

IsTimeoutError check if the error is timeout

Types

type DetailedError

type DetailedError struct {
	// contains filtered or unexported fields
}

DetailedError contains more information.

func (*DetailedError) As

func (de *DetailedError) As(target interface{}) bool

As returns if the given target matches the current error, if so sets target to the error value and returns true

func (*DetailedError) Error

func (de *DetailedError) Error() string

Error implements the error interface.

func (*DetailedError) ErrorType

func (de *DetailedError) ErrorType() error

ErrorType returns the basic error type.

func (*DetailedError) Is

func (de *DetailedError) Is(target error) bool

Is returns if the given error matches the current error.

func (*DetailedError) Stack

func (de *DetailedError) Stack() string

Stack record stack info

func (*DetailedError) Timeout

func (de *DetailedError) Timeout() bool

Timeout supports the os.IsTimeout checking.

func (*DetailedError) Unwrap

func (de *DetailedError) Unwrap() error

Unwrap returns the cause of detailed error.

func (*DetailedError) WithExtraMsg

func (de *DetailedError) WithExtraMsg(errMsg string)

WithExtraMsg to add extra msg to supply error msg

Jump to

Keyboard shortcuts

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