errcode

package
v0.0.0-...-d62a2a9 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SuccessCode Err = 0 //成功返回错误码
	ErrCode     Err = 1
	ModuleCode      = 100 * ErrCode
	ServerCode      = ModuleCode * 100
)

type errCode errcode.Err 错误代码100101,其中 10 代表gaf管理平台;中间的 01 代表系统运行中产生的错误;最后的 01 代表模块下的错误码序号,每个模块可以注册 100 个错误 0代表成功

View Source
const (
	GafSysCode      = 1 * ModuleCode //系统中产生的错误代码
	GafInitCode     = 2 * ModuleCode //初始化模块
	GafUserCode     = 3 * ModuleCode //用户信息模块
	GafKeyCode      = 4 * ModuleCode //密钥管理
	GafSysConfCode  = 5 * ModuleCode //系统配置模块
	GafLogCode      = 6 * ModuleCode //日志模块
	GafSelfTestCode = 8 * ModuleCode //自检程序
)

模块代码

View Source
const (
	GafSysErr              = GafServer + GafSysCode + iota + 1
	GafSysJsonMarshalErr   //转json失败
	GafSysJsonUnMarshalErr //json解析失败
	GafSysTimeParseErr     //时间转换错误
	GafSysSaveFileErr      //保存文件错误
)

系统运行中的错误

View Source
const (
	GafSysDBErr       = GafServer + GafSysCode + iota + 20 //数据库出错
	GafSysDBFindErr                                        //数据库查询出错
	GafSysDBCreateErr                                      //数据库添加数据出错
	GafSysDBUpdateErr                                      //数据库更新出错
	GafSysDBDeleteErr                                      //数据库删除出错
	GafSysCmdErr                                           //执行宿主机cmd指令出错
	GafSysNetworkErr                                       //网卡配置出错
)

系统运行中数据库出现的错误

View Source
const (
	GafSysCacheErr    = GafServer + GafSysCode + iota + 30 //缓存错误
	GafSysCacheGetErr                                      //缓存获取错误
	GafSysCacheSetErr                                      //缓存获取错误
)

系统运行中的缓存错误

View Source
const (
	GafConfErr           = GafServer + GafSysConfCode + iota + 1 //高级配置
	GafUpdateFileErr                                             //升级包名称错误
	GafUpdateFileReadErr                                         //升级包目录中文件读取错误
	GafUpdateFileLoadErr                                         //升级包镜像导入错误
	GafUpdateAssistErr                                           // 请求助手升级失败
)

高级配置模块

View Source
const (
	GafUserErr          = GafServer + GafUserCode + iota + 1 //用户错误
	GafUserLoginErr                                          //登录错误
	GafUserNotFoundErr                                       //用户不存在
	GafUserPasswdErr                                         //密码错误
	GafUserWithoutToken                                      //未携带token
	GafUserTokenExpired                                      //token过期
	GafUserRoleErr                                           // 用户的role_id错误
	GafUserForbiddenErr                                      // 用户没有权限
	GafUserHasExist                                          //用户已存在
)

用户相关的错误 user

View Source
const (
	GafServer = 10 * ServerCode // gaf管理平台
)

Variables

View Source
var (
	ErrRecordNotFound = gorm.ErrRecordNotFound
	ErrKeyNotFound    = gcache.KeyNotFoundError
)

Functions

This section is empty.

Types

type Err

type Err int32

func (Err) String

func (e Err) String() string

Jump to

Keyboard shortcuts

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