uerrors

package module
v0.0.0-...-319f72c Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2018 License: Apache-2.0 Imports: 5 Imported by: 8

README

uerrors

通用的统一定义errors

Documentation

Index

Constants

View Source
const PREFIX = "uerrors"

Variables

View Source
var (
	/**
	 * content in define
	 */
	ErrParamsNotMatch = NewCodeErrorWithPrefix(PREFIX, "000001")
)

Functions

This section is empty.

Types

type CodeError

type CodeError interface {
	error
	Code() string
	Prefix() string
	MsgBody() string

	WithMsgBody(content string) CodeError

	/**
	 * build err object
	 */
	Build(args ...string) CodeError

	/**
	 * build err object
	 */
	BuildByMap(args map[string]interface{}) CodeError
}

func NewCodeError

func NewCodeError(code string, msgContent ...string) CodeError

*

  • create public method code error , use simple code handle --

func NewCodeErrorWithPrefix

func NewCodeErrorWithPrefix(prefix string, code string, msgContent ...string) CodeError

*

  • create new code error

type ValidatorError

type ValidatorError interface {
	CodeError
}

Jump to

Keyboard shortcuts

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