Documentation ¶
Index ¶
- Variables
- func IsKitexError(err error) bool
- func IsTimeoutError(err error) bool
- type DetailedError
- func (de *DetailedError) As(target interface{}) bool
- func (de *DetailedError) Error() string
- func (de *DetailedError) ErrorType() error
- func (de *DetailedError) Is(target error) bool
- func (de *DetailedError) Stack() string
- func (de *DetailedError) Timeout() bool
- func (de *DetailedError) Unwrap() error
- func (de *DetailedError) WithExtraMsg(extraMsg string)
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"} // ErrRPCFinish 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")) ErrNoInstance = ErrServiceDiscovery.WithCause(errors.New("no instance available")) )
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 ¶
IsKitexError reports whether the given err is an error generated by kitex.
func IsTimeoutError ¶
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) 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(extraMsg string)
WithExtraMsg to add extra msg to supply error msg
Click to show internal directories.
Click to hide internal directories.