ex

package
v1.0.25 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BIZ     = 100000 // 普通业务异常
	JSON    = 999994 // JSON转换异常
	NUMBER  = 999995 // 数值转换异常
	DATA    = 999996 // 数据服务异常
	CACHE   = 999997 // 缓存服务异常
	SYSTEM  = 999998 // 系统级异常
	UNKNOWN = 999999 // 未知异常
)
View Source
const (
	JSON_ERR    = "响应数据构建失败"
	DATA_ERR    = "数据服务加载失败"
	DATA_C_ERR  = "数据保存失败"
	DATA_R_ERR  = "数据查询失败"
	DATA_U_ERR  = "数据更新失败"
	DATA_D_ERR  = "数据删除失败"
	CACHE_ERR   = "缓存服务加载失败"
	CACHE_C_ERR = "缓存数据保存失败"
	CACHE_R_ERR = "缓存数据读取失败"
	CACHE_U_ERR = "缓存数据更新失败"
	CACHE_D_ERR = "缓存数据删除失败"
)

Variables

This section is empty.

Functions

func InitLogAdapter

func InitLogAdapter(input ILogger) error

Types

type ILogger

type ILogger interface {
	Log(try Try) error
}

type LocalWriter

type LocalWriter int

func (LocalWriter) Log

func (self LocalWriter) Log(try Try) error

type Try

type Try struct {
	Code int         `json:"code"`
	Msg  string      `json:"msg"`
	Err  error       `json:"-"`
	Ext  interface{} `json:"obj,omitempty"`
}

func Catch

func Catch(err error) Try

func (Try) Error

func (self Try) Error() string

Jump to

Keyboard shortcuts

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