1Panel/core/constant/errs.go

60 lines
1.5 KiB
Go
Raw Normal View History

2024-07-19 19:04:11 +08:00
package constant
import (
"errors"
)
const (
CodeSuccess = 200
CodeErrBadRequest = 400
CodeErrUnauthorized = 401
CodeErrNotFound = 404
CodeAuth = 406
CodeGlobalLoading = 407
CodeErrInternalServer = 500
CodeErrIP = 310
CodeErrDomain = 311
CodeErrEntrance = 312
CodePasswordExpired = 313
CodeErrXpack = 410
)
// internal
var (
ErrCaptchaCode = errors.New("ErrCaptchaCode")
ErrAuth = errors.New("ErrAuth")
ErrRecordExist = errors.New("ErrRecordExist")
ErrRecordNotFound = errors.New("ErrRecordNotFound")
2024-07-22 16:14:59 +08:00
ErrTransform = errors.New("ErrTransform")
2024-07-19 19:04:11 +08:00
ErrInitialPassword = errors.New("ErrInitialPassword")
ErrInvalidParams = errors.New("ErrInvalidParams")
ErrNotSupportType = errors.New("ErrNotSupportType")
2024-07-19 19:04:11 +08:00
2024-07-25 14:43:41 +08:00
ErrTokenParse = errors.New("ErrTokenParse")
ErrStructTransform = errors.New("ErrStructTransform")
ErrPortInUsed = "ErrPortInUsed"
ErrCmdTimeout = "ErrCmdTimeout"
ErrGroupIsUsed = "ErrGroupIsUsed"
2024-07-19 19:04:11 +08:00
)
// api
var (
ErrTypeInternalServer = "ErrInternalServer"
ErrTypeInvalidParams = "ErrInvalidParams"
ErrTypeNotLogin = "ErrNotLogin"
ErrTypePasswordExpired = "ErrPasswordExpired"
ErrDemoEnvironment = "ErrDemoEnvironment"
2024-07-22 16:14:59 +08:00
ErrEntrance = "ErrEntrance"
2024-07-25 18:13:57 +08:00
ErrProxy = "ErrProxy"
ErrLocalDelete = "ErrLocalDelete"
2024-07-19 19:04:11 +08:00
)
// backup
var (
ErrBackupInUsed = "ErrBackupInUsed"
ErrBackupLocalDelete = "ErrBackupLocalDelete"
ErrMasterAddr = "ErrMasterAddr"
)