Documentation ¶
Index ¶
Constants ¶
View Source
const ( ErrcodeNamespace = "ERRCODE" DefaultErrorNamespace = "ERR" )
View Source
const ( ErrcodeParseTmplError = 1 ErrcodeExecTmpleError = 2 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ErrCode ¶
type ErrCode interface { Id() string Code() uint64 Namespace() string Error() string StackTrace() string Context() ErrorContext FullError() error Append(err ...interface{}) ErrCode WithMessage(extraMsg string) ErrCode WithContext(k string, v interface{}) ErrCode Marshal() ([]byte, error) }
func NewErrorCode ¶
type ErrCodeTemplate ¶
type ErrCodeTemplate struct {
// contains filtered or unexported fields
}
func T ¶
func T(code uint64, template string) ErrCodeTemplate
func (*ErrCodeTemplate) IsEqual ¶
func (p *ErrCodeTemplate) IsEqual(err error) bool
func (*ErrCodeTemplate) New ¶
func (p *ErrCodeTemplate) New(v ...Params) (err ErrCode)
type ErrorContext ¶
type ErrorContext map[string]interface{}
func (ErrorContext) String ¶
func (p ErrorContext) String() string
Click to show internal directories.
Click to hide internal directories.