errorx

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Analyze

func Analyze(src string, sub string) bool

Analyze 分析字符串是否包含在源字符串中

Types

type Error

type Error struct {
	Code    int32  `json:"code"`
	Message string `json:"message"`
}

Error 自定义错误

var (
	// SUCCESS 成功,无错误
	SUCCESS *Error
	// ArgumentError 请求参数错误
	ArgumentError *Error
	// VerifyCodeError 验证码错误
	VerifyCodeError *Error
	// PasswordFormatError 密码格式错误
	PasswordFormatError *Error
	// MobileFormatError 手机号格式错误
	MobileFormatError *Error
	// ConfirmPasswordError 确认密码错误
	ConfirmPasswordError *Error
	// MobileUsedError 手机号已被使用
	MobileUsedError *Error
	// IDCardFormatError 身份证格式错误
	IDCardFormatError *Error
	// DateFormatError 生日格式错误
	DateFormatError *Error
	// LoginError 账号或密码错误
	LoginError *Error
	// GenderError 性别错误
	GenderError *Error
	// MustIDError ID必须存在
	MustIDError *Error
	// NoAuthError 没有权限访问
	NoAuthError *Error
	// TooMuchRequestError 请求频繁
	TooMuchRequestError *Error
	// NoNeedToUpdateError 不需要更新
	NoNeedToUpdateError *Error
	// AccountUsedError 账号已存在
	AccountUsedError *Error
	// TokenError Token错误
	TokenError *Error
	// DataExistedError 数据已存在
	DataExistedError *Error
	// DataNotExistError 数据不存在
	DataNotExistError *Error
	// FileNotExistedError 文件不存在
	FileNotExistedError *Error
	// UploadFileError 文件上传失败
	UploadFileError *Error
	// DatabaseError 数据库执行错误
	DatabaseError *Error
	// EmptyResultError 结果集为空
	EmptyResultError *Error
	// IDServiceError ID服务错误
	IDServiceError *Error
	// RedisError 缓存服务器错误
	RedisError *Error
	// DisposeDataError 数据处理错误
	DisposeDataError *Error
	// ServiceBusyError 服务繁忙
	ServiceBusyError *Error
	// ServiceError 未知服务器错误
	ServiceError *Error
)

func New

func New(code int32, msg string) *Error

New 新建错误

func (*Error) Error

func (e *Error) Error() string

func (*Error) Replace

func (e *Error) Replace(msg string) *Error

Replace 替换消息提示

Jump to

Keyboard shortcuts

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