errors

package
v0.0.0-...-849f898 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2020 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	OK                  = NewError(0, "ok")
	ErrBadRequest       = NewError(10100001, "bad request")
	ErrServerError      = NewError(10100002, "server error")
	ErrServerBusy       = NewError(10100003, "server busy")
	ErrAuthInvalid      = NewError(10100004, "auth invalid")
	ErrAuthExpired      = NewError(10100005, "auth expired")
	ErrAuthForbiden     = NewError(10100006, "auth forbiden")
	ErrClientDeprecated = NewError(10100007, "this version of client is deprecated")
	ErrRateLimit        = NewError(10100008, "server busy")
	ErrInvalidAppid     = NewError(10100009, "invliad appid")
	ErrInvalidSign      = NewError(10100010, "invliad signature")
	ErrUnmarshalReq     = NewError(10100011, "unmarshal request error")
	ErrInvalidParam     = NewError(10100012, "invliad param")
)

error code format:

code = [appid(2)][module(3)][code(3)]

alread:

component/user: 10-001-xxx

global errors:

Functions

This section is empty.

Types

type BaseError

type BaseError struct {
	Code int
	Msg  string
}

BaseError ...

func NewError

func NewError(code int, msg string) BaseError

NewError ...

func (BaseError) Equals

func (e BaseError) Equals(b BaseError) bool

Equals ...

func (BaseError) Err

func (e BaseError) Err() error

Err get error

func (BaseError) Error

func (e BaseError) Error() string

Error interface for type error

func (BaseError) SetErr

func (e BaseError) SetErr(code int, err error) BaseError

SetErr ...

type IBaseError

type IBaseError interface {
	Code() int
	Msg() string
	Err() error
}

IBaseError ...

Jump to

Keyboard shortcuts

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