Documentation ¶
Index ¶
Constants ¶
View Source
const ( ErrGenericServerError = -1 ErrNoAccessPermission = 1 ErrLoginUsernameIsEmpty = 2 ErrMissingParameter = 3 ErrIllegalParameter = 4 ErrDuplicateRecord = 5 )
Variables ¶
View Source
var ( GenericServerError = rest.ResponseBase{ Code: ErrGenericServerError, Message: "服务返回错误", } NoAccessPermission = rest.ResponseBase{ Code: ErrNoAccessPermission, Message: "没有访问权限", } LoginUsernameIsEmpty = rest.ResponseBase{ Code: ErrLoginUsernameIsEmpty, Message: "用户名不能为空", } MissingParameter = rest.ResponseBase{ Code: ErrMissingParameter, Message: "字段填写不完整", } IllegalParameter = rest.ResponseBase{ Code: ErrIllegalParameter, Message: "字段非法", } DuplicateRecord = rest.ResponseBase{ Code: ErrDuplicateRecord, Message: "重复数据", } )
这里包含一些预定义的错误码和提示信息
Functions ¶
func GetError ¶
func GetError(err error) rest.ResponseBase
func GetErrorFromString ¶
func GetErrorFromString(errMessage string) rest.ResponseBase
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.