Documentation ¶ Index ¶ Variables func GetCodeMessage(e error) (int, string) type Code type Error func New(status *Status, originals ...error) *Error func (e *Error) Error() string func (e *Error) GetStatus() *Status type Status func GetStatus(e error) *Status func (status *Status) FmtMsg(val ...interface{}) *Status Constants ¶ This section is empty. Variables ¶ View Source var UnknownError = &Status{Code: 10000, Message: "未知错误"} Functions ¶ func GetCodeMessage ¶ func GetCodeMessage(e error) (int, string) Types ¶ type Code ¶ type Code int type Error ¶ type Error struct { Status *Status Original error } func New ¶ func New(status *Status, originals ...error) *Error func (*Error) Error ¶ func (e *Error) Error() string func (*Error) GetStatus ¶ func (e *Error) GetStatus() *Status type Status ¶ type Status struct { Code int `json:"code"` Message string `json:"message"` } func GetStatus ¶ func GetStatus(e error) *Status func (*Status) FmtMsg ¶ func (status *Status) FmtMsg(val ...interface{}) *Status Source Files ¶ View all Source files error.go Click to show internal directories. Click to hide internal directories.