1Panel/backend/constant/errs.go

103 lines
2.4 KiB
Go
Raw Normal View History

2022-08-16 23:30:23 +08:00
package constant
import (
"errors"
)
const (
CodeSuccess = 200
CodeErrBadRequest = 400
CodeErrUnauthorized = 401
2022-09-15 17:15:03 +08:00
CodeErrUnSafety = 402
2022-08-16 23:30:23 +08:00
CodeErrForbidden = 403
CodeErrNotFound = 404
CodePasswordExpired = 405
CodeAuth = 406
2023-01-31 15:22:05 +08:00
CodeGlobalLoading = 407
2022-08-16 23:30:23 +08:00
CodeErrInternalServer = 500
CodeErrHeader = 406
)
// internal
var (
ErrCaptchaCode = errors.New("ErrCaptchaCode")
2022-12-02 18:52:43 +08:00
ErrAuth = errors.New("ErrAuth")
2022-08-16 23:30:23 +08:00
ErrRecordExist = errors.New("ErrRecordExist")
ErrRecordNotFound = errors.New("ErrRecordNotFound")
ErrStructTransform = errors.New("ErrStructTransform")
2022-09-08 18:47:15 +08:00
ErrInitialPassword = errors.New("ErrInitialPassword")
ErrNotSupportType = errors.New("ErrNotSupportType")
ErrInvalidParams = errors.New("ErrInvalidParams")
2022-08-16 23:30:23 +08:00
ErrTokenParse = errors.New("ErrTokenParse")
ErrPageGenerate = errors.New("generate page info failed")
ErrRepoNotValid = "ErrRepoNotValid"
2022-08-16 23:30:23 +08:00
)
// api
var (
ErrTypeInternalServer = "ErrInternalServer"
ErrTypeInvalidParams = "ErrInvalidParams"
ErrTypeToken = "ErrToken"
ErrTypeTokenTimeOut = "ErrTokenTimeOut"
ErrTypeNotLogin = "ErrNotLogin"
ErrTypePasswordExpired = "ErrPasswordExpired"
ErrTypeNotSafety = "ErrNotSafety"
ErrNameIsExist = "ErrNameIsExist"
2023-02-21 15:19:12 +08:00
ErrDemoEnvironment = "ErrDemoEnvironment"
2022-08-16 23:30:23 +08:00
)
// app
var (
ErrPortInUsed = "ErrPortInUsed"
ErrAppLimit = "ErrAppLimit"
ErrAppRequired = "ErrAppRequired"
ErrFileCanNotRead = "ErrFileCanNotRead"
ErrFileToLarge = "ErrFileToLarge"
ErrNotInstall = "ErrNotInstall"
ErrPortInOtherApp = "ErrPortInOtherApp"
ErrDbUserNotValid = "ErrDbUserNotValid"
ErrUpdateBuWebsite = "ErrUpdateBuWebsite"
)
//website
var (
ErrDomainIsExist = "ErrDomainIsExist"
ErrAliasIsExist = "ErrAliasIsExist"
2022-12-12 15:36:45 +08:00
ErrAppDelete = "ErrAppDelete"
ErrGroupIsUsed = "ErrGroupIsUsed"
)
//ssl
var (
ErrSSLCannotDelete = "ErrSSLCannotDelete"
ErrAccountCannotDelete = "ErrAccountCannotDelete"
2023-01-04 11:44:43 +08:00
ErrSSLApply = "ErrSSLApply"
ErrEmailIsExist = "ErrEmailIsExist"
)
2023-02-09 14:31:05 +08:00
//file
var (
ErrPathNotFound = "ErrPathNotFound"
ErrMovePathFailed = "ErrMovePathFailed"
ErrLinkPathNotFound = "ErrLinkPathNotFound"
ErrFileIsExit = "ErrFileIsExit"
2023-02-09 14:31:05 +08:00
)
2023-03-07 16:44:16 +08:00
//mysql
var (
ErrUserIsExist = "ErrUserIsExist"
ErrDatabaseIsExist = "ErrDatabaseIsExist"
)
2023-03-08 17:02:06 +08:00
//redis
var (
ErrTypeOfRedis = "ErrTypeOfRedis"
)
//container
var (
ErrInUsed = "ErrInUsed"
)