bizerr

package
v0.1.19 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToGrpcError

func ToGrpcError(err error) error

Types

type BizError added in v0.1.19

type BizError interface {
	error
	Code() int
	Reason() string
	Detail() map[string]any
	WithDetail(kvs ...any) BizError
}

func FromGrpcError

func FromGrpcError(err error) BizError

FromGrpcError 从grpc status error获取额外的错误信息

func FromProto added in v0.1.19

func FromProto(enum protoreflect.Enum, message string, kvs ...any) BizError

func InternalError

func InternalError(message string, kvs ...any) BizError

func New

func New[T constraints.Integer](code T, reason, message string, kvs ...any) BizError

New error with error code

Jump to

Keyboard shortcuts

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