1Panel/backend/constant/errs.go

166 lines
4.3 KiB
Go
Raw Normal View History

2022-08-16 15:30:23 +00:00
package constant
import (
"errors"
)
const (
CodeSuccess = 200
CodeErrBadRequest = 400
CodeErrUnauthorized = 401
2022-09-15 09:15:03 +00:00
CodeErrUnSafety = 402
2022-08-16 15:30:23 +00:00
CodeErrForbidden = 403
CodeErrNotFound = 404
CodePasswordExpired = 405
CodeAuth = 406
2023-01-31 07:22:05 +00:00
CodeGlobalLoading = 407
CodeErrIP = 408
CodeErrDomain = 409
2022-08-16 15:30:23 +00:00
CodeErrInternalServer = 500
CodeErrHeader = 406
CodeErrXpack = 410
2022-08-16 15:30:23 +00:00
)
// internal
var (
ErrCaptchaCode = errors.New("ErrCaptchaCode")
2022-12-02 10:52:43 +00:00
ErrAuth = errors.New("ErrAuth")
2022-08-16 15:30:23 +00:00
ErrRecordExist = errors.New("ErrRecordExist")
ErrRecordNotFound = errors.New("ErrRecordNotFound")
ErrStructTransform = errors.New("ErrStructTransform")
2022-09-08 10:47:15 +00:00
ErrInitialPassword = errors.New("ErrInitialPassword")
ErrNotSupportType = errors.New("ErrNotSupportType")
ErrInvalidParams = errors.New("ErrInvalidParams")
2022-08-16 15:30:23 +00:00
ErrTokenParse = errors.New("ErrTokenParse")
)
// api
var (
ErrTypeInternalServer = "ErrInternalServer"
ErrTypeInvalidParams = "ErrInvalidParams"
ErrTypeNotLogin = "ErrNotLogin"
ErrTypePasswordExpired = "ErrPasswordExpired"
ErrNameIsExist = "ErrNameIsExist"
2023-02-21 07:19:12 +00:00
ErrDemoEnvironment = "ErrDemoEnvironment"
ErrCmdIllegal = "ErrCmdIllegal"
ErrXpackNotFound = "ErrXpackNotFound"
ErrXpackNotActive = "ErrXpackNotActive"
ErrXpackOutOfDate = "ErrXpackOutOfDate"
2022-08-16 15:30:23 +00:00
)
// app
var (
ErrPortInUsed = "ErrPortInUsed"
ErrAppLimit = "ErrAppLimit"
ErrFileCanNotRead = "ErrFileCanNotRead"
ErrNotInstall = "ErrNotInstall"
ErrPortInOtherApp = "ErrPortInOtherApp"
ErrDbUserNotValid = "ErrDbUserNotValid"
ErrUpdateBuWebsite = "ErrUpdateBuWebsite"
Err1PanelNetworkFailed = "Err1PanelNetworkFailed"
2023-04-12 06:16:29 +00:00
ErrCmdTimeout = "ErrCmdTimeout"
ErrFileParse = "ErrFileParse"
ErrInstallDirNotFound = "ErrInstallDirNotFound"
ErrContainerName = "ErrContainerName"
ErrAppNameExist = "ErrAppNameExist"
2023-11-14 10:00:09 +00:00
ErrFileNotFound = "ErrFileNotFound"
ErrFileParseApp = "ErrFileParseApp"
ErrAppParamKey = "ErrAppParamKey"
)
// website
var (
ErrDomainIsExist = "ErrDomainIsExist"
ErrAliasIsExist = "ErrAliasIsExist"
ErrGroupIsUsed = "ErrGroupIsUsed"
ErrUsernameIsExist = "ErrUsernameIsExist"
ErrUsernameIsNotExist = "ErrUsernameIsNotExist"
ErrBackupMatch = "ErrBackupMatch"
ErrBackupExist = "ErrBackupExist"
ErrDomainIsUsed = "ErrDomainIsUsed"
)
// ssl
var (
ErrSSLCannotDelete = "ErrSSLCannotDelete"
ErrAccountCannotDelete = "ErrAccountCannotDelete"
ErrSSLApply = "ErrSSLApply"
ErrEmailIsExist = "ErrEmailIsExist"
ErrEabKidOrEabHmacKeyCannotBlank = "ErrEabKidOrEabHmacKeyCannotBlank"
)
2023-02-09 06:31:05 +00:00
// file
2023-02-09 06:31:05 +00:00
var (
ErrPathNotFound = "ErrPathNotFound"
ErrMovePathFailed = "ErrMovePathFailed"
ErrLinkPathNotFound = "ErrLinkPathNotFound"
ErrFileIsExit = "ErrFileIsExit"
ErrFileUpload = "ErrFileUpload"
ErrFileDownloadDir = "ErrFileDownloadDir"
ErrCmdNotFound = "ErrCmdNotFound"
ErrFavoriteExist = "ErrFavoriteExist"
2023-02-09 06:31:05 +00:00
)
2023-03-07 08:44:16 +00:00
// mysql
2023-03-07 08:44:16 +00:00
var (
ErrUserIsExist = "ErrUserIsExist"
ErrDatabaseIsExist = "ErrDatabaseIsExist"
ErrExecTimeOut = "ErrExecTimeOut"
ErrRemoteExist = "ErrRemoteExist"
ErrLocalExist = "ErrLocalExist"
2023-03-07 08:44:16 +00:00
)
2023-03-08 09:02:06 +00:00
// redis
2023-03-08 09:02:06 +00:00
var (
ErrTypeOfRedis = "ErrTypeOfRedis"
)
// container
var (
ErrInUsed = "ErrInUsed"
ErrObjectInUsed = "ErrObjectInUsed"
ErrPortRules = "ErrPortRules"
ErrPgImagePull = "ErrPgImagePull"
)
2023-03-31 06:02:28 +00:00
// runtime
var (
ErrDirNotFound = "ErrDirNotFound"
ErrFileNotExist = "ErrFileNotExist"
ErrImageBuildErr = "ErrImageBuildErr"
ErrImageExist = "ErrImageExist"
ErrDelWithWebsite = "ErrDelWithWebsite"
ErrRuntimeStart = "ErrRuntimeStart"
ErrPackageJsonNotFound = "ErrPackageJsonNotFound"
ErrScriptsNotFound = "ErrScriptsNotFound"
)
var (
ErrBackupInUsed = "ErrBackupInUsed"
ErrOSSConn = "ErrOSSConn"
ErrEntrance = "ErrEntrance"
)
var (
ErrFirewall = "ErrFirewall"
)
// cronjob
var (
ErrBashExecute = "ErrBashExecute"
)
var (
ErrNotExistUser = "ErrNotExistUser"
)
// license
var (
ErrLicense = "ErrLicense"
ErrLicenseCheck = "ErrLicenseCheck"
ErrLicenseSave = "ErrLicenseSave"
ErrLicenseSync = "ErrLicenseSync"
)