|
| 1 | +package errno |
| 2 | + |
| 3 | +//nolint: golint |
| 4 | +var ( |
| 5 | + // Common errors |
| 6 | + OK = &Errno{Code: 0, Message: "OK"} |
| 7 | + InternalServerError = &Errno{Code: 10001, Message: "Internal server error"} |
| 8 | + ErrBind = &Errno{Code: 10002, Message: "Error occurred while binding the request body to the struct."} |
| 9 | + ErrParam = &Errno{Code: 10003, Message: "参数有误"} |
| 10 | + ErrSignParam = &Errno{Code: 10004, Message: "签名参数有误"} |
| 11 | + |
| 12 | + ErrValidation = &Errno{Code: 20001, Message: "Validation failed."} |
| 13 | + ErrDatabase = &Errno{Code: 20002, Message: "Database error."} |
| 14 | + ErrToken = &Errno{Code: 20003, Message: "Error occurred while signing the JSON web token."} |
| 15 | + ErrInvalidTransaction = &Errno{Code: 20004, Message: "invalid transaction."} |
| 16 | + |
| 17 | + // user errors |
| 18 | + ErrEncrypt = &Errno{Code: 20101, Message: "Error occurred while encrypting the user password."} |
| 19 | + ErrUserNotFound = &Errno{Code: 20102, Message: "The user was not found."} |
| 20 | + ErrTokenInvalid = &Errno{Code: 20103, Message: "The token was invalid."} |
| 21 | + ErrPasswordIncorrect = &Errno{Code: 20104, Message: "The password was incorrect."} |
| 22 | + ErrAreaCodeEmpty = &Errno{Code: 20105, Message: "手机区号不能为空"} |
| 23 | + ErrPhoneEmpty = &Errno{Code: 20106, Message: "手机号不能为空"} |
| 24 | + ErrGenVCode = &Errno{Code: 20107, Message: "生成验证码错误"} |
| 25 | + ErrSendSMS = &Errno{Code: 20108, Message: "发送短信错误"} |
| 26 | + ErrSendSMSTooMany = &Errno{Code: 20109, Message: "已超出当日限制,请明天再试"} |
| 27 | + ErrVerifyCode = &Errno{Code: 20110, Message: "验证码错误"} |
| 28 | + ErrEmailOrPassword = &Errno{Code: 20111, Message: "邮箱或密码错误"} |
| 29 | + ErrTwicePasswordNotMatch = &Errno{Code: 20112, Message: "两次密码输入不一致"} |
| 30 | + ErrRegisterFailed = &Errno{Code: 20113, Message: "注册失败"} |
| 31 | +) |
0 commit comments