Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Error ¶
type Error struct {
ID string `json:"id"`
Namespace string `json:"namespace"`
Code uint64 `json:"code"`
Message string `json:"message"`
}
Error error define
type ErrorCode ¶
type ErrorCode interface {
ID() string
Code() uint64
Namespace() string
Error() string
StackTrace() string
Context() ErrorContext
FullError() error
Append(err ...interface{}) ErrorCode
WithContext(k string, v interface{}) ErrorCode
Marshal() ([]byte, error)
}
ErrorCode Error functions
type ErrorCodeTmpl ¶
type ErrorCodeTmpl struct {
// contains filtered or unexported fields
}
ErrorCodeTmpl error code template
func TN ¶
func TN(namespace string, code uint64, message string) *ErrorCodeTmpl
TN returns a new error code template
func (*ErrorCodeTmpl) New ¶
func (p *ErrorCodeTmpl) New(v ...Params) ErrorCode
New ErrorCodeTmpl new error code by template
type ErrorContext ¶
type ErrorContext map[string]interface{}
ErrorContext map contexts
func (ErrorContext) String ¶
func (p ErrorContext) String() string
Click to show internal directories.
Click to hide internal directories.