Documentation ¶
Index ¶
Constants ¶
View Source
const CAPTCHA_ERROR uint32 = 700
View Source
const DB_ERROR uint32 = 555
View Source
const DB_UPDATE_AFFECTED_ZERO_ERROR uint32 = 556
View Source
const FORBIDDEN_ERROR uint32 = 403
View Source
const NOT_FOUND_ERROR uint32 = 404
View Source
const OK uint32 = 0
成功返回
View Source
const REQUEST_PARAM_ERROR uint32 = 400
全局错误码 client
View Source
const SERVER_COMMON_ERROR uint32 = 500
server
View Source
const TOKEN_EXPIRE_ERROR uint32 = 401
View Source
const TOKEN_GENERATE_ERROR uint32 = 560
Variables ¶
View Source
var ( ErrNotFound = NewErrCodeMsg(NOT_FOUND_ERROR, "not found") ErrUserNoExists = NewErrCodeMsg(TOKEN_EXPIRE_ERROR, "user not found") ErrUserForbidden = NewErrCode(FORBIDDEN_ERROR) ErrCaptcha = NewErrCodeMsg(CAPTCHA_ERROR, "captcha error") ErrRequestParamError = NewErrCode(REQUEST_PARAM_ERROR) ErrDBError = NewErrCode(DB_ERROR) ErrServerError = NewErrCode(SERVER_COMMON_ERROR) )
Functions ¶
func GetErrCodeMsg ¶
Types ¶
type CodeError ¶
type CodeError struct {
// contains filtered or unexported fields
}
func NewErrCode ¶
func NewErrCodeMsg ¶
func NewParamErrMsg ¶
Click to show internal directories.
Click to hide internal directories.