errors

package
v0.0.0-...-75939a1 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AuthErrorReason_name = map[int32]string{
		0: "UNKNOWN_ERROR",
		3: "BUSINESS_ERROR",
		1: "NOT_LOGIN",
		2: "NOT_AUTHORITY",
		8: "CONFLICT_ERROR",
		6: "PARAMS_ERROR",
		7: "PRECONDITION_REQUIRED",
	}
	AuthErrorReason_value = map[string]int32{
		"UNKNOWN_ERROR":         0,
		"BUSINESS_ERROR":        3,
		"NOT_LOGIN":             1,
		"NOT_AUTHORITY":         2,
		"CONFLICT_ERROR":        8,
		"PARAMS_ERROR":          6,
		"PRECONDITION_REQUIRED": 7,
	}
)

Enum value maps for AuthErrorReason.

View Source
var File_api_errors_error_proto protoreflect.FileDescriptor

Functions

func ErrorBusinessError

func ErrorBusinessError(format string, args ...interface{}) *errors.Error

func ErrorConflictError

func ErrorConflictError(format string, args ...interface{}) *errors.Error

func ErrorNotAuthority

func ErrorNotAuthority(format string, args ...interface{}) *errors.Error

func ErrorNotLogin

func ErrorNotLogin(format string, args ...interface{}) *errors.Error

func ErrorParamsError

func ErrorParamsError(format string, args ...interface{}) *errors.Error

func ErrorPreconditionRequired

func ErrorPreconditionRequired(format string, args ...interface{}) *errors.Error

func ErrorUnknownError

func ErrorUnknownError(format string, args ...interface{}) *errors.Error

func IsBusinessError

func IsBusinessError(err error) bool

func IsConflictError

func IsConflictError(err error) bool

func IsNotAuthority

func IsNotAuthority(err error) bool

func IsNotLogin

func IsNotLogin(err error) bool

func IsParamsError

func IsParamsError(err error) bool

func IsPreconditionRequired

func IsPreconditionRequired(err error) bool

func IsUnknownError

func IsUnknownError(err error) bool

Types

type AuthErrorReason

type AuthErrorReason int32

异常错误

const (
	AuthErrorReason_UNKNOWN_ERROR AuthErrorReason = 0
	// 业务错误
	AuthErrorReason_BUSINESS_ERROR AuthErrorReason = 3
	// 未登陆
	AuthErrorReason_NOT_LOGIN AuthErrorReason = 1
	// 无权限
	AuthErrorReason_NOT_AUTHORITY AuthErrorReason = 2
	// 资源冲突
	AuthErrorReason_CONFLICT_ERROR AuthErrorReason = 8
	// 参数错误
	AuthErrorReason_PARAMS_ERROR AuthErrorReason = 6
	// 请求需要先决条件
	AuthErrorReason_PRECONDITION_REQUIRED AuthErrorReason = 7
)

func (AuthErrorReason) Descriptor

func (AuthErrorReason) Enum

func (x AuthErrorReason) Enum() *AuthErrorReason

func (AuthErrorReason) EnumDescriptor deprecated

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

Deprecated: Use AuthErrorReason.Descriptor instead.

func (AuthErrorReason) Number

func (AuthErrorReason) String

func (x AuthErrorReason) String() string

func (AuthErrorReason) Type

Jump to

Keyboard shortcuts

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