ecode

package
v0.0.0-...-d64fc3f Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BadRequest

func BadRequest(reason, message string) error

BadRequest new BadRequest error that is mapped to a 400 response.

func Conflict

func Conflict(reason, message string) error

Conflict new Conflict error that is mapped to a 409 response.

func ErrNotExistMd

func ErrNotExistMd(format string, a ...interface{}) error

func ErrSignService

func ErrSignService(format string, a ...interface{}) error

func Forbidden

func Forbidden(reason, message string) error

Forbidden new Forbidden error that is mapped to a 403 response.

func GormErrRecordNotFound

func GormErrRecordNotFound(err error) error

func InternalServer

func InternalServer(reason, message string) error

InternalServer new InternalServer error that is mapped to a 500 response.

func IsErrNotExistMd

func IsErrNotExistMd(err error) bool

func IsErrSignService

func IsErrSignService(err error) bool

func IsGormErrRecordNotFound

func IsGormErrRecordNotFound(err error) bool

func IsJsonSyntaxError

func IsJsonSyntaxError(err error) bool

func IsRedisNil

func IsRedisNil(err error) bool

func IsSaramaErrClosedClient

func IsSaramaErrClosedClient(err error) bool

func JsonSyntaxError

func JsonSyntaxError(err *json.SyntaxError) error

func Newf

func Newf(code int, reason, format string, a ...interface{}) *errors.Error

Newf New(code fmt.Sprintf(format, a...))

func NotFound

func NotFound(reason, message string) error

NotFound new NotFound error that is mapped to a 404 response.

func ReadTimeout

func ReadTimeout(domain, reason, format string, a ...interface{}) error

系统错误

func RedisNil

func RedisNil() error

func SaramaErrClosedClient

func SaramaErrClosedClient(err error) error

func SignCheckErr

func SignCheckErr(domain, reason, format string, a ...interface{}) error

main ecode interval is [0,990000]

func Unauthorized

func Unauthorized(reason, message string) error

Unauthorized new Unauthorized error that is mapped to a 401 response.

func Unknown

func Unknown(format string, a ...interface{}) error

func Validate

func Validate(format string, a ...interface{}) error

func WrapError

func WrapError(err error) error

FromError 格式字符串

Types

This section is empty.

Jump to

Keyboard shortcuts

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