code

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InvalidArgument   codes.Code = 100001
	Unauthenticated              = 100002
	Unimplemented                = 100003
	UserAlreadyExists            = 100004
	UserNotExists                = 100005
	WrongPassword                = 100006

	Timeout  = 100108
	Canceled = 100109
	Internal = 100110
	Unknown  = 100111
)

很多直接返回的会返回grpc自带的OK,所以ok我们不能自定义 很多grpc自己不会抛出的错误我们应该自己重新定义,一些grpc自己会产生的我们也可以自定义一下 grpc会自己抛出的错误我们应该做转换 每个服务可以给1000个错误码的容量

Variables

This section is empty.

Functions

func FromError added in v1.0.3

func FromError(err error) (codes.Code, string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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