func (de *DetailedError) Timeout() bool {
	return de.basic == ErrRPCTimeout || os.IsTimeout(de.cause)
}
Timeout supports the os.IsTimeout checking.
package kerrors
import (
	"errors"
	"os"
	"strings"
)
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 = &basicError{"rpc call finished"}
)
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"))
)
type basicError struct {
	message string
}
func (be *basicError) Error() string {
	return be.message
}
func (be *basicError) WithCause(cause error) error {
	return &DetailedError{basic: be, cause: cause}
}
func (be *basicError) WithCauseAndStack(cause error, stack string) error {
	return &DetailedError{basic: be, cause: cause, stack: stack}
}
func (be *basicError) Timeout() bool {
	return be == ErrRPCTimeout
}
type DetailedError struct {
	basic    *basicError
	cause    error
	stack    string
	extraMsg string
}
func (de *DetailedError) Error() string {
	msg := appendErrMsg(de.basic.Error(), de.extraMsg)
	if de.cause != nil {
		return msg + ": " + de.cause.Error()
	}
	return msg
}
func (de *DetailedError) ErrorType() error {
	return de.basic
}
func (de *DetailedError) Unwrap() error {
	return de.cause
}
func (de *DetailedError) Is(target error) bool {
	return de == target || de.basic == target || errors.Is(de.cause, target)
}
func (de *DetailedError) As(target interface{}) bool {
	if errors.As(de.basic, target) {
		return true
	}
	return errors.As(de.cause, target)
}