Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( OK = add(0) // Success InvalidParams = add(-1) // Unknown Parameters RequestErr = add(-400) AccessDenied = add(-403) NothingFound = add(-404) MethodNotAllowed = add(-405) Conflict = add(-409) InvalidCors = add(-410) Canceled = add(-498) ServerErr = add(-500) Deadline = add(-504) LimitExceed = add(-509) )
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.