errcode

package
v0.0.0-...-63c9515 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Success                   = NewError(0, "success")
	ServerError               = NewError(10000000, "server internal error")
	InvalidParams             = NewError(10000001, "invalid parameters")
	NotFound                  = NewError(10000002, "not found")
	UnauthorizedAuthNotExist  = NewError(10000003, "unauthorized, AppKey and AppSecret not found")
	UnauthorizedTokenError    = NewError(10000004, "unauthorized, token error")
	UnauthorizedTokenTimeout  = NewError(10000005, "unauthorized, token timeout")
	UnauthorizedTokenGenerate = NewError(10000006, "unauthorized, token generation failed")
	TooManyRequests           = NewError(10000007, "too many requests")
)
View Source
var (
	ErrorGetTagListFail = NewError(20010001, "get tag list failed")
	ErrorCreateTagFail  = NewError(20010002, "create tag failed")
	ErrorUpdateTagFail  = NewError(20010003, "update tag failed")
	ErrorDeleteTagFail  = NewError(20010004, "delete tag failed")
	ErrorCountTagFail   = NewError(20010005, "count tag failed")

	ErrorGetArticleFail    = NewError(20020001, "get article failed")
	ErrorGetArticlesFail   = NewError(20020002, "get articles failed")
	ErrorCreateArticleFail = NewError(20020003, "create article failed")
	ErrorUpdateArticleFail = NewError(20020004, "update article failed")
	ErrorDeleteArticleFail = NewError(20020005, "delete article failed")

	ErrorUploadFileFail = NewError(20030001, "upload file failed")
)

Functions

This section is empty.

Types

type Error

type Error struct {
	// contains filtered or unexported fields
}

func NewError

func NewError(code int, msg string) *Error

func (*Error) Code

func (e *Error) Code() int

func (*Error) Details

func (e *Error) Details() []string

func (*Error) Error

func (e *Error) Error() string

func (*Error) Msg

func (e *Error) Msg() string

func (*Error) Msgf

func (e *Error) Msgf(args ...interface{}) string

func (*Error) StatusCode

func (e *Error) StatusCode() int

func (*Error) WithDetails

func (e *Error) WithDetails(details ...string) *Error

Jump to

Keyboard shortcuts

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