1Panel/backend/constant/errs.go

40 lines
938 B
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
CodeErrInternalServer = 500
CodeErrHeader = 406
)
// internal
var (
ErrCaptchaCode = errors.New("ErrCaptchaCode")
ErrRecordExist = errors.New("ErrRecordExist")
ErrRecordNotFound = errors.New("ErrRecordNotFound")
ErrStructTransform = errors.New("ErrStructTransform")
2022-09-08 18:47:15 +08:00
ErrInitialPassword = errors.New("ErrInitialPassword")
2022-08-16 23:30:23 +08:00
ErrTokenParse = errors.New("ErrTokenParse")
ErrPageGenerate = errors.New("generate page info failed")
)
// api
var (
ErrTypeInternalServer = "ErrInternalServer"
ErrTypeInvalidParams = "ErrInvalidParams"
ErrTypeToken = "ErrToken"
ErrTypeTokenTimeOut = "ErrTokenTimeOut"
2022-09-15 17:15:03 +08:00
ErrTypeNotLogin = "ErrNotLogin"
ErrTypeNotSafety = "ErrNotSafety"
2022-08-16 23:30:23 +08:00
)