errors

package
v0.0.0-...-99b28bf Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2021 License: MIT Imports: 1 Imported by: 4

Documentation

Index

Constants

View Source
const (
	CUserOrPasswordFailed = 1000 // 账号密码错误
	CWithoutAuthorization = 1001 // 没有鉴权
	CAuthorizationFailed  = 1002 // 鉴权错误
	CCaptchaMissed        = 1003 // 没有验证码
	CCaptchaIncorrect     = 1004 // 验证码错误
	CAccountUnavailable   = 1005 // 账号不可用
	CHasNoPermission      = 1006 // 没有权限
	CFormInvalid          = 1007 // 表单参数格式错误
	CInvalid              = 1008 // 无效请求
	CConflict             = 1009 // 与现有数据冲突
	CNotFound             = 1010 // 没找到所查找Object
	CORMError             = 1011 // ORM错误
	CServiceError         = 1012 // 业务逻辑错误
	CLimitError           = 1013 // 操作被限制
	CUnknownError         = 1999 // 未知的错误
)

Variables

This section is empty.

Functions

func GValidError2MapData

func GValidError2MapData(err gvalid.Error) map[string][]string

Types

type ServerError

type ServerError struct {
	Code    int
	Message string
	Err     error
}

func AccountUnavailableError

func AccountUnavailableError(message string, errs ...error) *ServerError

func AuthorizationFailedError

func AuthorizationFailedError(message string, errs ...error) *ServerError

func CaptchaIncorrectError

func CaptchaIncorrectError(message string, errs ...error) *ServerError

func CaptchaMissedError

func CaptchaMissedError(message string, errs ...error) *ServerError

func ConflictError

func ConflictError(message string, errs ...error) *ServerError

func FormFormatInvalidError

func FormFormatInvalidError(message string, errs ...error) *ServerError

func InvalidError

func InvalidError(message string, errs ...error) *ServerError

func LimitError

func LimitError(message string, errs ...error) *ServerError

func NotFoundError

func NotFoundError(message string, errs ...error) *ServerError

func NotPermissionError

func NotPermissionError(message string, errs ...error) *ServerError

func ORMError

func ORMError(message string, errs ...error) *ServerError

func ServiceError

func ServiceError(message string, errs ...error) *ServerError

func UserOrPasswordFailed

func UserOrPasswordFailed(message string, errs ...error) *ServerError

func WithoutAuthorizationError

func WithoutAuthorizationError(message string, errs ...error) *ServerError

func (*ServerError) Error

func (s *ServerError) Error() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL