ts_error

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Success      = 0
	ParamInvalid = 10001 // 无效的参数
	ParamIsEmpty = 10002

	DataFromDBErr = 20001 // FROM数据库错误
	DataToDBErr   = 20002 // TO数据库错误

	PortHoldErr      = 30001
	DoHttpRequestErr = 30002
	SystemErr        = 40001

	BusinessErr = 50001
)

统一错误码

Variables

View Source
var BindErr = &BaseResponse{Code: ParamInvalid, Msg: "无效的参数"}
View Source
var EmptyParamErr = func(paramName string) *BaseResponse {
	return &BaseResponse{Code: ParamIsEmpty, Msg: fmt.Sprintf("参数[%s]不能为空", paramName)}
}

Functions

This section is empty.

Types

type BaseResponse

type BaseResponse struct {
	Code int32  `json:"code"`
	Msg  string `json:"msg"`
}

Jump to

Keyboard shortcuts

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