errcode

package
v0.0.0-...-e282ec7 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorCode

type ErrorCode int

错误码格式 x yyy zz 开头第一位为错误级别 2 成功 4 应用错误/参数 5 系统错误 后三位为服务类型,服务类型全000为特殊通用,不允许使用,最后两位为错误码序号

const (
	OK                   ErrorCode = 200000
	InternalServerError  ErrorCode = 500000
	UnauthorizedError    ErrorCode = 400000
	ParameterFormatError ErrorCode = 400001
	PermissionDenied     ErrorCode = 400002
	VisitTooFrequently   ErrorCode = 400003
)
const (
	FileNotExist          ErrorCode = 400200
	FileDownloadDirError  ErrorCode = 400201 // 不能下载一个文件夹
	FileNotDirError       ErrorCode = 400202 // 不是文件夹
	FileStorageFulled     ErrorCode = 400203 // 文件储存已满
	FileRootOperateError  ErrorCode = 400204 // 不能对根文件进行操作
	FileDirNotExists      ErrorCode = 400205 // 文件夹不存在
	FileParentNotDirError ErrorCode = 400206 // 父结点不是一个文件夹
	FileAlreadyExists     ErrorCode = 400207 // 文件(夹)已经存在
	FileTooLarge          ErrorCode = 400208
	FilenameFormatError   ErrorCode = 400209 // 文件名格式错误
)
const (
	EmailAlreadyExists        ErrorCode = 400101
	EmailNotFound             ErrorCode = 400102
	UsernameAlreadyExists     ErrorCode = 400103
	UsernameNotFound          ErrorCode = 400104
	EmailActiveCodeError      ErrorCode = 400105
	ResetPwdCodeError         ErrorCode = 400106
	IncorrectUserNameOrPwd    ErrorCode = 400107
	EmailFormatError          ErrorCode = 400108
	EmailResetPwdCodeError    ErrorCode = 400109
	UserOldPwdIncorrect       ErrorCode = 400110
	UserAvatarSizeTooLarge    ErrorCode = 400111
	UserNotFound              ErrorCode = 400112
	EmailActiveCodeTooOften   ErrorCode = 400113
	EmailResetPwdCodeTooOften ErrorCode = 400114
)

func (ErrorCode) Message

func (e ErrorCode) Message() string

Jump to

Keyboard shortcuts

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