Versions in this module Expand all Collapse all v1 v1.0.4 Feb 19, 2024 v1.0.3 Feb 14, 2024 Changes in this version type StatusFunc + func WithField(key, value string) StatusFunc v1.0.2 Feb 8, 2024 Changes in this version + const ClientClosed + var File_pkg_errorx_errorx_proto protoreflect.FileDescriptor + func Cause(err error) error + func CreateBaseErrCode() + func Fatal(err error, msg ...string) + func FromGRPCCode(code codes.Code) int + func Stack(err error) string + func ToGRPCCode(code int) codes.Code + func Wrap(err error, format string, a ...interface{}) error + func WrapErr(err error, code ErrCode) error + type BatchError struct + func (be *BatchError) Add(errs ...error) + func (be *BatchError) Err() error + func (be *BatchError) NotNil() bool + type Converter interface + FromGRPCCode func(code codes.Code) int + ToGRPCCode func(code int) codes.Code + var DefaultConverter Converter = statusConverter{} + type ErrCode uint64 + const ErrApiCodeAgentMax + const ErrApiCodeCapacityTooBig + const ErrApiCodeConfIsBusy2 + const ErrApiCodeDelTopGroup + const ErrApiCodeEmailRepeat + const ErrApiCodeGroupIndepFailed + const ErrApiCodeGroupLevelTooBig + const ErrApiCodeGroupNotEmpty + const ErrApiCodeMobileRepeat + const ErrApiCodeParentGroupNotExist + const ErrApiCodeShouldBindJSON + const ErrCodeAssertionValue + const ErrCodeBaseMax + const ErrCodeBusy + const ErrCodeDBQueryCountRepeat + const ErrCodeDBQueryFailed + const ErrCodeDbConnFailed + const ErrCodeGetPathValue + const ErrCodeJsonErr + const ErrCodeLogFileClosed + const ErrCodeLogPathNotSet + const ErrCodeMqALLConnFailed + const ErrCodeMqRabbitConnFailed + const ErrCodeMqRedisConnFailed + const ErrCodeMsgTypeMismatch + const ErrCodeNetWorkErr + const ErrCodeNotAuthorized + const ErrCodeNotFound + const ErrCodeOK + const ErrCodeParamsErr + const ErrCodeRedisCacheDelFailed + const ErrCodeRedisCacheNotMiss + const ErrCodeRedisConnFailed + const ErrCodeRedisKeyIsEmpty + const ErrCodeRedisWaitCASTimeout + const ErrCodeStandard + const ErrCodeTimeOut + const ErrCodeUnknown + const ErrCodeWatcherFileStop + const ErrRpcCodeAgentMax + const ErrRpcCodeCapacityTooBig + const ErrRpcCodeConfIsBusy2 + const ErrRpcCodeDelTopGroup + const ErrRpcCodeEmailRepeat + const ErrRpcCodeGroupIndepFailed + const ErrRpcCodeGroupLevelTooBig + const ErrRpcCodeGroupNotEmpty + const ErrRpcCodeMobileRepeat + const ErrRpcCodeParentGroupNotExist + const ErrRpcServerNotFound + func (e ErrCode) Code() uint64 + func (e ErrCode) Error() string + type Error struct + Cause error + Stack string + func BadRequest() *Error + func ErrStatus(status interface{}) *Error + func New(err error, opts ...StatusFunc) *Error + func NotFound(reason, message string) *Error + func Unauthorized(reason, message string) *Error + func (e *Error) GRPCStatus() *status.Status + func (e *Error) Is(err error) bool + func (e *Error) SetCause(err error) *Error + func (e *Error) SetMetadata(md map[string]string) *Error + func (e *Error) SetStack() *Error + func (e *Error) Unwrap() + func (e *Error) UnwrapFunc(f func() interface{}) + func (e Error) Error() string + type ErrorInter interface + Is func(err error) bool + type ErrorModels []*Status + type Status struct + Code uint64 + Message string + Metadata map[string]string + Reason string + func (*Status) Descriptor() ([]byte, []int) + func (*Status) ProtoMessage() + func (s *Status) StringTo16() string + func (x *Status) GetCode() uint64 + func (x *Status) GetMessage() string + func (x *Status) GetMetadata() map[string]string + func (x *Status) GetReason() string + func (x *Status) ProtoReflect() protoreflect.Message + func (x *Status) Reset() + func (x *Status) String() string + type StatusFunc func(status *Status) + func WithReason(reason string) StatusFunc