errno

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: May 28, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrorReason_name = map[int32]string{
	0: "INTERNAL_SERVER",
	1: "BAD_REQUEST",
	2: "TIMEOUT",
	3: "CUSTOM",
	4: "BIZ_ERROR",
	5: "USER_OR_PASSWORD_INCORRECT",
}
View Source
var ErrorReason_value = map[string]int32{
	"INTERNAL_SERVER":            0,
	"BAD_REQUEST":                1,
	"TIMEOUT":                    2,
	"CUSTOM":                     3,
	"BIZ_ERROR":                  4,
	"USER_OR_PASSWORD_INCORRECT": 5,
}

Functions

func ErrBadRequest

func ErrBadRequest(message ...string) *errors.Error

func ErrBadRequestf added in v0.0.2

func ErrBadRequestf(format string, a ...any) *errors.Error

func ErrBadRequestw added in v0.0.2

func ErrBadRequestw(opt ...Option) *errors.Error

func ErrBizError

func ErrBizError(message ...string) *errors.Error

func ErrBizErrorf added in v0.0.2

func ErrBizErrorf(format string, a ...any) *errors.Error

func ErrBizErrorw added in v0.0.2

func ErrBizErrorw(opt ...Option) *errors.Error

func ErrCustom

func ErrCustom(message ...string) *errors.Error

func ErrCustomf added in v0.0.2

func ErrCustomf(format string, a ...any) *errors.Error

func ErrCustomw added in v0.0.2

func ErrCustomw(opt ...Option) *errors.Error

func ErrInternalServer

func ErrInternalServer(message ...string) *errors.Error

func ErrInternalServerf added in v0.0.2

func ErrInternalServerf(format string, a ...any) *errors.Error

func ErrInternalServerw added in v0.0.2

func ErrInternalServerw(opt ...Option) *errors.Error

func ErrTimeout

func ErrTimeout(message ...string) *errors.Error

func ErrTimeoutf added in v0.0.2

func ErrTimeoutf(format string, a ...any) *errors.Error

func ErrTimeoutw added in v0.0.2

func ErrTimeoutw(opt ...Option) *errors.Error

func ErrUserOrPasswordIncorrect

func ErrUserOrPasswordIncorrect(message ...string) *errors.Error

func ErrUserOrPasswordIncorrectf added in v0.0.2

func ErrUserOrPasswordIncorrectf(format string, a ...any) *errors.Error

func ErrUserOrPasswordIncorrectw added in v0.0.2

func ErrUserOrPasswordIncorrectw(opt ...Option) *errors.Error

func IsBadRequest added in v0.0.2

func IsBadRequest(err error) bool

func IsBizError added in v0.0.2

func IsBizError(err error) bool

func IsCustom added in v0.0.2

func IsCustom(err error) bool

func IsInternalServer added in v0.0.2

func IsInternalServer(err error) bool

func IsTimeout added in v0.0.2

func IsTimeout(err error) bool

func IsUserOrPasswordIncorrect added in v0.0.2

func IsUserOrPasswordIncorrect(err error) bool

Types

type ErrorReason

type ErrorReason int32
const (
	ErrorReason_INTERNAL_SERVER            ErrorReason = 0
	ErrorReason_BAD_REQUEST                ErrorReason = 1
	ErrorReason_TIMEOUT                    ErrorReason = 2
	ErrorReason_CUSTOM                     ErrorReason = 3
	ErrorReason_BIZ_ERROR                  ErrorReason = 4
	ErrorReason_USER_OR_PASSWORD_INCORRECT ErrorReason = 5
)

func (ErrorReason) EnumDescriptor

func (ErrorReason) EnumDescriptor() ([]byte, []int)

func (ErrorReason) String

func (x ErrorReason) String() string

type Option added in v0.0.2

type Option interface {
	// contains filtered or unexported methods
}

func WithDetail added in v0.0.2

func WithDetail(s string) Option

func WithMessage added in v0.0.2

func WithMessage(s string) Option

func WithMetadata added in v0.0.2

func WithMetadata(k string, v string) Option

Jump to

Keyboard shortcuts

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