Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( AiliCloudSuccess = &Errno{HTTP: 200, Code: "0", Message: "suc"} SmsSuccess = &Errno{HTTP: 200, Code: "0", Message: "suc"} )
View Source
var ( // OK 代表请求成功. OK = &Errno{HTTP: 200, Code: "", Message: ""} // InternalServerError 表示所有未知的服务器端错误. InternalServerError = &Errno{HTTP: 500, Code: "InternalError", Message: "Internal server error."} // ErrPageNotFound 表示路由不匹配错误. ErrPageNotFound = &Errno{HTTP: 404, Code: "ResourceNotFound.PageNotFound", Message: "Page not found."} // ErrBind 表示参数绑定错误. ErrBind = &Errno{HTTP: 400, Code: "InvalidParameter.BindError", Message: "Error occurred while binding the request body to the struct."} // ErrInvalidParameter 表示所有验证失败的错误. ErrInvalidParameter = &Errno{HTTP: 400, Code: "InvalidParameter", Message: "Parameter verification failed."} // ErrSignToken 表示签发 JWT Token 时出错. ErrSignToken = &Errno{HTTP: 401, Code: "AuthFailure.SignTokenError", Message: "Error occurred while signing the JSON web token."} // ErrTokenInvalid 表示 JWT Token 格式错误. ErrTokenInvalid = &Errno{HTTP: 401, Code: "AuthFailure.TokenInvalid", Message: "Token was invalid."} ErrUnauthorized = &Errno{HTTP: 401, Code: "AuthFailure.Unauthorized", Message: "Unauthorized."} ErrUserAlreadyExist = &Errno{HTTP: 400, Code: "FailedOperation.UserAlreadyExist", Message: "User already exist."} ErrIdempotentTokenExpired = &Errno{HTTP: 400, Code: "IdempotentToken.Expired", Message: "idempotent token is invalid"} ErrTemplateCount = &Errno{HTTP: 400, Code: "TemplateCountFailure.ExceedLimit", Message: "Exceed limit for this template"} ErrMobileCount = &Errno{HTTP: 400, Code: "MobileCountFailure.ExceedLimit", Message: "Exceed limit for this phone"} ErrTimestampCount = &Errno{HTTP: 400, Code: "TimestampCountFailure.TooFrequently", Message: "Sent message too frequently"} )
Functions ¶
Types ¶
type Errno ¶
Errno 定义了 monster 使用的错误类型.
func (*Errno) SetMessage ¶
SetMessage 设置 Errno 类型错误中的 Message 字段.
Click to show internal directories.
Click to hide internal directories.