Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( OK = add(0) // 正确 Canceled = add(-498) // 客户端取消请求 ServerErr = add(-500) // 服务器错误 Deadline = add(-504) // 服务调用超时 )
All common ecode
Functions ¶
Types ¶
type Code ¶
type Code int
A Code is an int error code spec.
func New ¶
New new a ecode.Codes by int value. NOTE: ecode must unique in global, the New will check repeat and then panic.
type Codes ¶
type Codes interface { // sometimes Error return Code in string form // NOTE: don't use Error in monitor report even it also work for now Error() string // Code get error code. Code() int // Message get code message. Message() string //Detail get error detail,it may be nil. Details() []interface{} }
Codes ecode error interface which has a code & message.
type Status ¶
type Status struct {
// contains filtered or unexported fields
}
Status statusError is an alias of a status proto implement ecode.Codes
Click to show internal directories.
Click to hide internal directories.