errorx

package
v1.7.3 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrorUnknown      = iota + 500 //未知错误
	ErrorTimeOut                   //请求超时
	ErrorParam                     //参数错误
	ErrorPwd                       //密码错误
	ErrorNoPower                   //无操作权限
	ErrorTimeFormat                //日期格式错误
	ErrorProcessMsg                //映射关系错误
	ErrorNatsConn                  //消息中心连接错误
	ErrorDataFormat                //数据格式转换错误
	ErrorUserChanged               //用户变更
	ErrorNotExt                    //数据不存在
	ErrorLoginAccount              //账户或密码错误
	ErrorInsert
	ErrorUpdate
	ErrorDelete
	ErrorQuery
	ErrorOrderWrong
	ErrorFailed
	ErrorFile //错误文件
	ErrorEqInit
	ErrorCanEdit
)
View Source
const MsgResponseOk = 0

Variables

View Source
var ErrorMap = map[int32]string{
	401:               "认证失败",
	ErrorUnknown:      "未知错误",
	ErrorTimeOut:      "请求超时",
	ErrorParam:        "参数错误",
	ErrorPwd:          "密码错误",
	ErrorNoPower:      "无操作权限",
	ErrorTimeFormat:   "日期格式错误",
	ErrorProcessMsg:   "映射关系错误",
	ErrorNatsConn:     "消息中心连接错误",
	ErrorDataFormat:   "数据格式转换错误",
	ErrorUserChanged:  "用户变更",
	ErrorNotExt:       "数据不存在",
	ErrorLoginAccount: "账户或密码错误",
	ErrorInsert:       "新增失败",
	ErrorUpdate:       "修改失败",
	ErrorDelete:       "删除失败",
	ErrorQuery:        "查询错误",
	ErrorOrderWrong:   "指令错误",
	ErrorFailed:       "操作失败",
	ErrorFile:         "缺少参数文件",
	ErrorEqInit:       "设备初始化错误",
	ErrorCanEdit:      "不可变更",
}

Functions

func ErrorMsg

func ErrorMsg(code int32) string

Types

type EC

type EC int

type ResultInfo

type ResultInfo struct {
	Code    int32       `json:"code"`
	Message string      `json:"message"`
	Reason  string      `json:"reason"`
	Data    interface{} `json:"data,omitempty"`
}

func ERROR

func ERROR(code int32, msg string) *ResultInfo

func Error

func Error(code int32) *ResultInfo

func Param

func Param() *ResultInfo

func SUCCESS

func SUCCESS(data interface{}) *ResultInfo

func Success

func Success() *ResultInfo

Jump to

Keyboard shortcuts

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