errcode

package
v0.0.0-...-5afd5f5 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorReason_name = map[int32]string{
		0: "Unknown",
		1: "InvalidParameter",
		2: "NotFound",
		3: "Unauthorized",
		4: "Forbidden",
		5: "OperationFailed",
	}
	ErrorReason_value = map[string]int32{
		"Unknown":          0,
		"InvalidParameter": 1,
		"NotFound":         2,
		"Unauthorized":     3,
		"Forbidden":        4,
		"OperationFailed":  5,
	}
)

Enum value maps for ErrorReason.

View Source
var File_proto_errcode_errcode_proto protoreflect.FileDescriptor

Functions

func ErrorForbidden

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

禁止访问错误

func ErrorInvalidParameter

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

无效参数错误

func ErrorNotFound

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

未找到错误

func ErrorOperationFailed

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

缺少幂等性令牌错误

func ErrorUnauthorized

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

未经授权错误

func ErrorUnknown

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

未知错误,服务器内部错误

func IsForbidden

func IsForbidden(err error) bool

禁止访问错误

func IsInvalidParameter

func IsInvalidParameter(err error) bool

无效参数错误

func IsNotFound

func IsNotFound(err error) bool

未找到错误

func IsOperationFailed

func IsOperationFailed(err error) bool

缺少幂等性令牌错误

func IsUnauthorized

func IsUnauthorized(err error) bool

未经授权错误

func IsUnknown

func IsUnknown(err error) bool

未知错误,服务器内部错误

Types

type ErrorReason

type ErrorReason int32
const (
	// 未知错误,服务器内部错误
	ErrorReason_Unknown ErrorReason = 0
	// 无效参数错误
	ErrorReason_InvalidParameter ErrorReason = 1
	// 未找到错误
	ErrorReason_NotFound ErrorReason = 2
	// 未经授权错误
	ErrorReason_Unauthorized ErrorReason = 3
	// 禁止访问错误
	ErrorReason_Forbidden ErrorReason = 4
	// 缺少幂等性令牌错误
	ErrorReason_OperationFailed ErrorReason = 5
)

func (ErrorReason) Descriptor

func (ErrorReason) Enum

func (x ErrorReason) Enum() *ErrorReason

func (ErrorReason) EnumDescriptor deprecated

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

Deprecated: Use ErrorReason.Descriptor instead.

func (ErrorReason) Number

func (x ErrorReason) Number() protoreflect.EnumNumber

func (ErrorReason) String

func (x ErrorReason) String() string

func (ErrorReason) Type

Jump to

Keyboard shortcuts

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