1Panel/backend/constant/errs.go
2022-10-06 15:41:57 +08:00

44 lines
1.1 KiB
Go

package constant
import (
"errors"
)
const (
CodeSuccess = 200
CodeErrBadRequest = 400
CodeErrUnauthorized = 401
CodeErrUnSafety = 402
CodeErrForbidden = 403
CodeErrNotFound = 404
CodePasswordExpired = 405
CodeErrInternalServer = 500
CodeErrHeader = 406
)
// internal
var (
ErrCaptchaCode = errors.New("ErrCaptchaCode")
ErrRecordExist = errors.New("ErrRecordExist")
ErrRecordNotFound = errors.New("ErrRecordNotFound")
ErrStructTransform = errors.New("ErrStructTransform")
ErrInitialPassword = errors.New("ErrInitialPassword")
ErrNotSupportType = errors.New("ErrNotSupportType")
ErrInvalidParams = errors.New("ErrInvalidParams")
ErrTokenParse = errors.New("ErrTokenParse")
ErrPageGenerate = errors.New("generate page info failed")
)
// api
var (
ErrTypeInternalServer = "ErrInternalServer"
ErrTypeInvalidParams = "ErrInvalidParams"
ErrTypeToken = "ErrToken"
ErrTypeTokenTimeOut = "ErrTokenTimeOut"
ErrTypeNotLogin = "ErrNotLogin"
ErrTypePasswordExpired = "ErrPasswordExpired"
ErrTypeNotSafety = "ErrNotSafety"
)