errcode

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2022 License: MIT Imports: 1 Imported by: 0

README

xxx

介绍
  1. xxxx
  2. xxxx
  3. xxxx
安装教程

go get github.com/jageros/hawox

使用例子
package main

import (
	"fmt"
	"github.com/jageros/hawox/xxx"
)

func main() {
	/*
	xxxxx
	xxxxx
	xxxxx
	*/
}
使用说明
  1. xxxx
  2. xxxx
  3. xxxx

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	UnknownErrCode      = err{0, "未知错误"}
	InternalErr         = err{-1, "服务器内部错误"}
	Success             = err{200, "successful"} // 成功
	VerifyErr           = err{401, "验证失败"}
	MetaCoderNotFound   = err{402, "meta解码器未注册"}
	ProtoMsgIdNoHandles = err{403, "该协议未注册"}
	ServiceNotFound     = err{404, "未找到该服务"}
	InvalidParam        = err{412, "无效参数"}
	Overload            = err{503, "请求超载"}
)

Functions

This section is empty.

Types

type IErr

type IErr interface {
	Error() string
	ErrMsg() string
	Code() int32
	WithErr(err_ error) IErr
	WithMsg(msg string) IErr
}

IErr 自定义错误接口

func New

func New(code int32, errMsg string) IErr

New 创建一个错误码,业务逻辑上的错误,错误码使用1000-1999

func WithErrcode

func WithErrcode(code int32, err_ error) IErr

Jump to

Keyboard shortcuts

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